mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 16:58:22 +01:00
fix event-stream handling bug on proxy mode
This commit is contained in:
parent
b9bd5e9ad1
commit
ca252b1d35
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user