Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 266
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: Sat May 11 23:36:22 CEST 2024

Total time taken to generate the page: 0.02639 seconds