mirror of https://github.com/ericonr/sndio.git
use a copy of the slowaccept flag, as it may change within the
poll() loop
This commit is contained in:
parent
c77ea93344
commit
cac23d61dc
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue