aboutsummaryrefslogtreecommitdiff
path: root/networking/fakeidentd.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-11 17:20:00 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-11 17:20:00 +0000
commitf7996f3b700a22797565e9aa57e251e6e3ac1e4d (patch)
treeaf4e797eef0a65f4e3dba94b325da0ec08452d36 /networking/fakeidentd.c
parent3821fb13ea404d243115ff8ec161273b62826513 (diff)
downloadbusybox-f7996f3b700a22797565e9aa57e251e6e3ac1e4d.tar.gz
Trailing whitespace removal over entire tree
Diffstat (limited to 'networking/fakeidentd.c')
-rw-r--r--networking/fakeidentd.c98
1 files changed, 49 insertions, 49 deletions
diff --git a/networking/fakeidentd.c b/networking/fakeidentd.c
index 8967a7a38..7eac48065 100644
--- a/networking/fakeidentd.c
+++ b/networking/fakeidentd.c
@@ -240,68 +240,68 @@ int fakeidentd_main(int argc, char **argv)
/* main loop where we process all events and never exit */
while (1) {
- fd_set rfds = G.readfds;
- struct timeval tv = { 15, 0 };
- int i;
- int tim = time(NULL);
-
- select(G.conncnt + FCS, &rfds, NULL, NULL, G.conncnt? &tv: NULL);
-
- for (i = G.conncnt - 1; i >= 0; i--) {
- int s = i + FCS;
-
- if (FD_ISSET(s, &rfds)) {
- char *buf = conns[i].buf;
- unsigned int len = conns[i].len;
- unsigned int l;
-
- if ((l = read(s, buf + len, sizeof(conns[0].buf) - len)) > 0) {
- if (checkInput(buf, len, l)) {
- reply(s, buf);
- goto deleteconn;
- } else if (len + l >= sizeof(conns[0].buf)) {
- replyError(s, "X-INVALID-REQUEST");
- goto deleteconn;
+ fd_set rfds = G.readfds;
+ struct timeval tv = { 15, 0 };
+ int i;
+ int tim = time(NULL);
+
+ select(G.conncnt + FCS, &rfds, NULL, NULL, G.conncnt? &tv: NULL);
+
+ for (i = G.conncnt - 1; i >= 0; i--) {
+ int s = i + FCS;
+
+ if (FD_ISSET(s, &rfds)) {
+ char *buf = conns[i].buf;
+ unsigned int len = conns[i].len;
+ unsigned int l;
+
+ if ((l = read(s, buf + len, sizeof(conns[0].buf) - len)) > 0) {
+ if (checkInput(buf, len, l)) {
+ reply(s, buf);
+ goto deleteconn;
+ } else if (len + l >= sizeof(conns[0].buf)) {
+ replyError(s, "X-INVALID-REQUEST");
+ goto deleteconn;
+ } else {
+ conns[i].len += l;
+ }
} else {
- conns[i].len += l;
+ goto deleteconn;
}
- } else {
- goto deleteconn;
- }
- conns[i].lasttime = tim;
- continue;
+ conns[i].lasttime = tim;
+ continue;
deleteconn:
- deleteConn(s);
- } else {
- /* implement as time_after() in linux kernel sources ... */
- if (conns[i].lasttime + MAXIDLETIME <= tim) {
- replyError(s, "X-TIMEOUT");
deleteConn(s);
+ } else {
+ /* implement as time_after() in linux kernel sources ... */
+ if (conns[i].lasttime + MAXIDLETIME <= tim) {
+ replyError(s, "X-TIMEOUT");
+ deleteConn(s);
+ }
}
}
- }
- if (FD_ISSET(0, &rfds)) {
- int s = accept(0, NULL, 0);
+ if (FD_ISSET(0, &rfds)) {
+ int s = accept(0, NULL, 0);
- if (s < 0) {
- if (errno != EINTR) /* EINTR */
- bb_perror_msg("accept");
- } else {
- if (G.conncnt == MAXCONNS)
- i = closeOldest();
- else
- i = G.conncnt++;
+ if (s < 0) {
+ if (errno != EINTR) /* EINTR */
+ bb_perror_msg("accept");
+ } else {
+ if (G.conncnt == MAXCONNS)
+ i = closeOldest();
+ else
+ i = G.conncnt++;
- movefd(s, i + FCS); /* move if not already there */
- FD_SET(i + FCS, &G.readfds);
+ movefd(s, i + FCS); /* move if not already there */
+ FD_SET(i + FCS, &G.readfds);
- conns[i].len = 0;
- conns[i].lasttime = time(NULL);
+ conns[i].len = 0;
+ conns[i].lasttime = time(NULL);
+ }
}
- }
} /* end of while (1) */
return 0;