mirror of
https://github.com/hufrea/byedpi.git
synced 2025-02-16 16:29:58 +03:00
set POLLRDHUP flag
This commit is contained in:
parent
47aad58e7c
commit
e3be71ea46
2 changed files with 7 additions and 6 deletions
11
conev.c
11
conev.c
|
@ -65,7 +65,7 @@ struct eval *add_event(struct poolhd *pool, enum eid type,
|
|||
struct pollfd *pfd = &(pool->pevents[pool->count]);
|
||||
|
||||
pfd->fd = fd;
|
||||
pfd->events = e;
|
||||
pfd->events = POLLRDHUP | e;
|
||||
pfd->revents = 0;
|
||||
#endif
|
||||
|
||||
|
@ -76,12 +76,13 @@ struct eval *add_event(struct poolhd *pool, enum eid type,
|
|||
|
||||
void del_event(struct poolhd *pool, struct eval *val)
|
||||
{
|
||||
assert(val && ((val->fd > 0 && val->mod_iter < pool->iters) ||
|
||||
val->mod_iter == pool->iters));
|
||||
assert(val->fd >= -1 && val->mod_iter <= pool->iters);
|
||||
if (val->fd == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef NOEPOLL
|
||||
assert(val->fd == pool->pevents[val->index].fd);
|
||||
#endif
|
||||
if (val->buff.data) {
|
||||
assert(val->buff.size);
|
||||
free(val->buff.data);
|
||||
|
@ -211,7 +212,7 @@ struct eval *next_event(struct poolhd *pool, int *offs, int *typel)
|
|||
int mod_etype(struct poolhd *pool, struct eval *val, int type)
|
||||
{
|
||||
assert(val->index >= 0 && val->index < pool->count);
|
||||
pool->pevents[val->index].events = type;
|
||||
pool->pevents[val->index].events = POLLRDHUP | type;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
2
proxy.c
2
proxy.c
|
@ -540,7 +540,7 @@ int on_tunnel(struct poolhd *pool, struct eval *val,
|
|||
ssize_t n = 0;
|
||||
struct eval *pair = val->pair;
|
||||
|
||||
if (pair->buff.size && out) {
|
||||
if (pair->buff.data && out) {
|
||||
pair = val;
|
||||
val = val->pair;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue