Compare commits

..
2 Commits
3 changed files with 21 additions and 6 deletions
+5
View File
@@ -2320,6 +2320,11 @@ fcntl(rdev->hnd, F_SETFL, flags | O_NONBLOCK);
/* as i know it's connected already, /* as i know it's connected already,
* i don't schedule a connection timeout job */ * i don't schedule a connection timeout job */
/* the connection is up already, so there is no connect timeout
* to schedule. the field must still be marked unset: the ssl
* handshake inherits it as its deadline, and a zero there is a
* deadline already in the past. set it to a negative value */
HIO_INIT_NTIME(&rdev->tmout, -1, 0);
rdev->remoteaddr = conn->remoteaddr; rdev->remoteaddr = conn->remoteaddr;
#if defined(USE_SSL) #if defined(USE_SSL)
rdev->ssl_ctx = ssl_ctx; rdev->ssl_ctx = ssl_ctx;
+14 -5
View File
@@ -646,9 +646,9 @@ int hio_sys_ctrlmux (hio_t* hio, hio_sys_mux_cmd_t cmd, hio_dev_t* dev, int dev_
if (x >= 0) if (x >= 0)
{ {
if (i_flag == EV_DISABLE && o_flag == EV_DISABLE) if (i_flag == EV_DISABLE && o_flag == EV_DISABLE)
dev->dev_cap &= ~HIO_DEV_CAP_WATCH_SUSPENDED;
else
dev->dev_cap |= HIO_DEV_CAP_WATCH_SUSPENDED; dev->dev_cap |= HIO_DEV_CAP_WATCH_SUSPENDED;
else
dev->dev_cap &= ~HIO_DEV_CAP_WATCH_SUSPENDED;
} }
break; break;
} }
@@ -876,6 +876,7 @@ int hio_sys_waitmux (hio_t* hio, const hio_ntime_t* tmout, hio_sys_mux_evtcb_t e
for (i = 0; i < nentries; i++) for (i = 0; i < nentries; i++)
{ {
int events = 0; int events = 0;
int rdhup = 0;
hio_dev_t* dev; hio_dev_t* dev;
dev = mux->revs[i].udata; dev = mux->revs[i].udata;
@@ -887,7 +888,11 @@ int hio_sys_waitmux (hio_t* hio, const hio_ntime_t* tmout, hio_sys_mux_evtcb_t e
if (mux->revs[i].ident != dev->dev_mth->getsyshnd(dev)) continue; /* already closed or something mid-loop? */ if (mux->revs[i].ident != dev->dev_mth->getsyshnd(dev)) continue; /* already closed or something mid-loop? */
if (mux->revs[i].flags & EV_ERROR) events |= HIO_DEV_EVENT_ERR; if (mux->revs[i].flags & EV_ERROR) events |= HIO_DEV_EVENT_ERR;
if (mux->revs[i].flags & EV_EOF) events |= HIO_DEV_EVENT_HUP; if (mux->revs[i].flags & EV_EOF)
{
if (mux->revs[i].filter == EVFILT_READ) rdhup = 1;
else events |= HIO_DEV_EVENT_HUP;
}
if (mux->revs[i].filter == EVFILT_READ) events |= HIO_DEV_EVENT_IN; if (mux->revs[i].filter == EVFILT_READ) events |= HIO_DEV_EVENT_IN;
else if (mux->revs[i].filter == EVFILT_WRITE) events |= HIO_DEV_EVENT_OUT; else if (mux->revs[i].filter == EVFILT_WRITE) events |= HIO_DEV_EVENT_OUT;
#else #else
@@ -903,13 +908,17 @@ int hio_sys_waitmux (hio_t* hio, const hio_ntime_t* tmout, hio_sys_mux_evtcb_t e
{ {
if (mux->revs[j].udata != dev) continue; if (mux->revs[j].udata != dev) continue;
if (mux->revs[j].flags & EV_ERROR) events |= HIO_DEV_EVENT_ERR; if (mux->revs[j].flags & EV_ERROR) events |= HIO_DEV_EVENT_ERR;
if (mux->revs[j].flags & EV_EOF) events |= HIO_DEV_EVENT_HUP; if (mux->revs[j].flags & EV_EOF)
{
if (mux->revs[j].filter == EVFILT_READ) rdhup = 1;
else events |= HIO_DEV_EVENT_HUP;
}
if (mux->revs[j].filter == EVFILT_READ) events |= HIO_DEV_EVENT_IN; if (mux->revs[j].filter == EVFILT_READ) events |= HIO_DEV_EVENT_IN;
else if (mux->revs[j].filter == EVFILT_WRITE) events |= HIO_DEV_EVENT_OUT; else if (mux->revs[j].filter == EVFILT_WRITE) events |= HIO_DEV_EVENT_OUT;
} }
#endif #endif
if (HIO_LIKELY(events)) event_handler(hio, dev, events, 0); if (HIO_LIKELY(events)) event_handler(hio, dev, events, rdhup);
} }
else if (mux->ctrlp[0] != HIO_SYSHND_INVALID) else if (mux->ctrlp[0] != HIO_SYSHND_INVALID)
{ {
+2 -1
View File
@@ -121,7 +121,8 @@ test_pxy()
# and the bytes themselves, not just the count. the upstream emits a # and the bytes themselves, not just the count. the upstream emits a
# repeating a-z pattern keyed to the offset. # repeating a-z pattern keyed to the offset.
local sum=$(curl -s -m 60 "http://${SRVADDR}/pxy/big" | cksum | cut -d' ' -f1) local sum=$(curl -s -m 60 "http://${SRVADDR}/pxy/big" | cksum | cut -d' ' -f1)
local want=$(perl -e 'print map { chr(97 + ($_ % 26)) } 0 .. (8*1024*1024 - 1)' 2>/dev/null | cksum | cut -d' ' -f1) ##local want=$(perl -e 'print map { chr(97 + ($_ % 26)) } 0 .. (8*1024*1024 - 1)' 2>/dev/null | cksum | cut -d' ' -f1)
local want=$(yes abcdefghijklmnopqrstuvwxyz | tr -d '\n' | head -c 8388608 | cksum | cut -d' ' -f1)
if [ -n "$want" ]; then if [ -n "$want" ]; then
tap_ensure "$sum" "$want" "$msg - the relayed bytes are identical to the upstream's" tap_ensure "$sum" "$want" "$msg - the relayed bytes are identical to the upstream's"
else else