U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ MT-multithreading and servers » [FIXED]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC)
Re: [BUG]HttpRequest hangs when Chunked response, without trailer, and KeepAlive is set. (patch & TC) [message #46324 is a reply to message #46292] Tue, 19 April 2016 11:36 Go to previous messageGo to previous message
omari is currently offline  omari
Messages: 276
Registered: March 2010
Experienced Member
Mirek, you are right,

when ReadingTrailer return true, we do not call Finish().


but the actual implementation of ReadingTrailer fail when a Trailer is present.

it miss the part :

	if(data.GetCount() > 3) {
			const char *h = data.Last();
			if(h[0] == '\n' && (h[-1] == '\r' && h[-2] == '\n' || h[-1] == '\n'))
				return false;
		}

(as ReadingHeader)

bool HttpRequest::ReadingTrailer()
{
	for(;;) {
		int c = TcpSocket::Get();
		if(c < 0)
			return !IsEof();
		else
			data.Cat(c);
		if(data.GetCount() == 2) {
			if(data[0] == '\r' && data[1] == '\n')
				return false;
		}
		if(data.GetCount() > 3) {
			const char *h = data.Last();
			if(h[0] == '\n' && (h[-1] == '\r' && h[-2] == '\n' || h[-1] == '\n'))
				return false;
		}
	}
}




regards
omari.

[Updated on: Tue, 19 April 2016 11:36]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: HttpRequest : Add custon authentication capability
Next Topic: NTLM Authentication for HttpRequest
Goto Forum:
  


Current Time: Fri Jul 17 07:31:29 GMT+2 2026

Total time taken to generate the page: 0.00673 seconds