needs to send proxied accounting requests.
However, we ONLY need to listen to proxy replies in the main
server. The accounting server SHOULD NOT look for proxy replies,
or we'll have two processes doing a recv() on the same FD.
else {
close(sockfd);
sockfd = -1;
- close(proxyfd);
- proxyfd = -1;
}
} else
log(L_INFO, "Ready to process requests.");
}
FD_ZERO(&readfds);
- if (sockfd >= 0)
+ if (sockfd >= 0) {
FD_SET(sockfd, &readfds);
+ /*
+ * ONLY listen for proxy replies in the
+ * main server, NOT the accounting server!
+ */
+ if (proxyfd >= 0)
+ FD_SET(proxyfd, &readfds);
+ }
if (acctfd >= 0)
FD_SET(acctfd, &readfds);
- if (proxyfd >= 0)
- FD_SET(proxyfd, &readfds);
status = select(32, &readfds, NULL, NULL, NULL);
if (status == -1) {