- for (fd = 0; (n_ready > 0) && (fd < FD_SETSIZE); fd++) {
- if (FD_ISSET (fd, &readfds)) {
-
- --n_ready;
-
- if (fd == sock_fd) {
- int i;
- RESERVE_CONFIG_BUFFER(tmpbuf, BUFSIZE + 1);
-
- memset(tmpbuf, '\0', BUFSIZE+1);
- if ( (i = recv(fd, tmpbuf, MAXLINE - 2, 0)) > 0) {
- if ( serveConnection(tmpbuf, i) <= 0 ) {
- close (fd);
- FD_CLR(fd, &fds);
- }
- } else {
- perror_msg_and_die ("UNIX socket error");
- }
- RELEASE_CONFIG_BUFFER (tmpbuf);
- } /* fd == sock_fd */
- }/* FD_ISSET() */
- }/* for */
+ if (FD_ISSET (sock_fd, &fds)) {
+ int i;
+ RESERVE_CONFIG_BUFFER(tmpbuf, BUFSIZ + 1);
+
+ memset(tmpbuf, '\0', BUFSIZ+1);
+ if ( (i = recv(sock_fd, tmpbuf, BUFSIZ, 0)) > 0) {
+ serveConnection(tmpbuf, i);
+ } else {
+ perror_msg_and_die ("UNIX socket error");
+ }
+ RELEASE_CONFIG_BUFFER (tmpbuf);
+ }/* FD_ISSET() */