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 #46332 is a reply to message #46324] Fri, 22 April 2016 09:33 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
omari wrote on Tue, 19 April 2016 11:36
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;
		}
	}
}




I suspect you were not testing with latest svn - there is no ReadingTrailer anymore...

I have tested with your testcase and it works as expected (great testcase BTW! adding it to autotest).

Mirek
 
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: Thu Jul 16 04:35:31 GMT+2 2026

Total time taken to generate the page: 0.00654 seconds