check for space in peers table before accepting new request
This commit is contained in:
@@ -214,14 +214,16 @@ int main(int argc, char **argv)
|
||||
continue;
|
||||
|
||||
if(pollfds[0].revents) {
|
||||
int len = recvmsg(socket, &msg , 0);
|
||||
int *peer_fds = fds_from_msg(&msg, 5);
|
||||
char *argline = malloc(len);
|
||||
memmove(argline, buf, len);
|
||||
if(find_peer(0)) {
|
||||
int len = recvmsg(socket, &msg , 0);
|
||||
int *peer_fds = fds_from_msg(&msg, 5);
|
||||
char *argline = malloc(len);
|
||||
memmove(argline, buf, len);
|
||||
|
||||
pid_t child_pid = fork_lua(L, argline, len, peer_fds, 5);
|
||||
if(child_pid >= 0) {
|
||||
register_peer(child_pid, &peer_addr, msg.msg_namelen);
|
||||
pid_t child_pid = fork_lua(L, argline, len, peer_fds, 5);
|
||||
if(child_pid >= 0) {
|
||||
register_peer(child_pid, &peer_addr, msg.msg_namelen);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user