1
0
mirror of https://github.com/lxsang/ant-http synced 2024-07-01 12:59:47 +02:00

fix event-stream handling bug on proxy mode

This commit is contained in:
lxsang 2021-02-05 03:38:56 +01:00
parent b9bd5e9ad1
commit ca252b1d35
2 changed files with 12 additions and 5 deletions

View File

@ -1517,7 +1517,14 @@ char *post_data_decode(void *client, int len)
}
if (stat == 0)
{
usleep(POLL_EVENT_TO*1000);
if (difftime(time(NULL), ((antd_client_t*)client)->last_io) > MAX_IO_WAIT_TIME)
{
stat = -1;
}
else
{
usleep(POLL_EVENT_TO*1000);
}
}
}

View File

@ -565,10 +565,10 @@ int antd_recv_upto(void *src, void *data, int len)
}
else
{
if (difftime(time(NULL), source->last_io) > MAX_IO_WAIT_TIME)
/*if (difftime(time(NULL), source->last_io) > MAX_IO_WAIT_TIME)
{
return -1;
}
}*/
switch (err)
{
case SSL_ERROR_NONE:
@ -607,10 +607,10 @@ int antd_recv_upto(void *src, void *data, int len)
time(&source->last_io);
return received;
}
else if (difftime(time(NULL), source->last_io) > MAX_IO_WAIT_TIME)
/*else if (difftime(time(NULL), source->last_io) > MAX_IO_WAIT_TIME)
{
return -1;
}
}*/
if (received <= 0 && (errno == EAGAIN || errno == EWOULDBLOCK))
{
return 0;