use a copy of the slowaccept flag, as it may change within the

poll() loop
This commit is contained in:
Alexandre Ratchov 2015-12-15 12:28:23 +01:00
parent c77ea93344
commit cac23d61dc
2 changed files with 7 additions and 1 deletions

View File

@ -217,7 +217,8 @@ listen_pollfd(void *arg, struct pollfd *pfd)
{ {
struct listen *f = arg; struct listen *f = arg;
if (file_slowaccept) f->slowaccept = file_slowaccept;
if (f->slowaccept)
return 0; return 0;
pfd->fd = f->fd; pfd->fd = f->fd;
pfd->events = POLLIN; pfd->events = POLLIN;
@ -227,6 +228,10 @@ listen_pollfd(void *arg, struct pollfd *pfd)
int int
listen_revents(void *arg, struct pollfd *pfd) listen_revents(void *arg, struct pollfd *pfd)
{ {
struct listen *f = arg;
if (f->slowaccept)
return 0;
return pfd->revents; return pfd->revents;
} }

View File

@ -24,6 +24,7 @@ struct listen {
struct file *file; struct file *file;
char *path; char *path;
int fd; int fd;
int slowaccept;
}; };
extern struct listen *listen_list; extern struct listen *listen_list;