Home » U++ Library support » U++ MT-multithreading and servers » [FIXED]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
[FIXED]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC) [message #46292] |
Fri, 08 April 2016 19:44  |
omari
Messages: 276 Registered: March 2010
|
Experienced Member |
|
|
Hi,
When HttpRequest is in TRAILER phase, he call ReadingHeader().
buf if there is no trailer, the socket contain only two charachter: \r\n.
because ReadingHeader() read at least three characters, il hangs waiting a third one.
Here a Test Case:
HttpRequest r("http://dev.alt.cloudappsportal.com/_api/web/lists");
r.KeepAlive().Execute();
A solution is to check if there is a trailer, and if not, read only \r\n and finish:
in the file Core\Http.cpp
Line : 385
replace :
case TRAILER:
if(ReadingHeader())
break;
header.ParseAdd(data);
Finish();
break;
case FINISHED:
by
case TRAILER:
if(TcpSocket::Peek() == '\r') // if the next line is empty (then no trailer)
{
TcpSocket::Get();
c2 = TcpSocket::Get();
if(c2 != '\n')
HttpError("missing ending CRLF");
Finish();
break;
}
if(ReadingHeader())
break;
header.ParseAdd(data);
Finish();
break;
case FINISHED:
regards
omari.
[Updated on: Sat, 18 March 2017 16:01] Report message to a moderator
|
|
|
 |
|
[FIXED]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: omari on Fri, 08 April 2016 19:44
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: mirek on Sun, 17 April 2016 08:58
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: omari on Sun, 17 April 2016 11:37
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: mirek on Sun, 17 April 2016 14:43
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: omari on Sun, 17 April 2016 22:10
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: mirek on Mon, 18 April 2016 17:44
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: omari on Mon, 18 April 2016 19:02
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: mirek on Tue, 19 April 2016 11:01
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: omari on Tue, 19 April 2016 11:36
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: mirek on Fri, 22 April 2016 09:33
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: omari on Fri, 22 April 2016 17:08
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: mirek on Mon, 25 April 2016 13:52
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: mirek on Mon, 25 April 2016 13:57
|
 |
|
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
By: omari on Tue, 19 April 2016 11:42
|
Goto Forum:
Current Time: Sat May 10 00:22:25 CEST 2025
Total time taken to generate the page: 0.02650 seconds
|