[Libwebsockets] libwebsockets-1.4 HTTP server help with huge http chunks

Ash 20001 ash20001 at hotmail.com
Wed Jul 1 00:19:10 CEST 2015


Sorry for the other emails, I have much easier reproducible steps for this that maybe you guys can help me with:
1. Build 1.4 test-server binary. 2. Run it with --ssl option. 3. Use an HTTP client on another machine, like Advanced Rest Client to send a POST data to https://<your server>:<your ssl port>. Start with under 4k sized payloads and notice it works and server receives both BODY and BODY COMPLETION.4. Change to higher than 4k POST data payload, and notice that the server only receives the first 4k chunk and then gets stuck.


From: andy.green at linaro.org
To: libwebsockets at ml.libwebsockets.org
Date: Tue, 30 Jun 2015 00:53:59 -0700
Subject: Re: [Libwebsockets] libwebsockets-1.4 HTTP server help with huge http chunks




One thing I forgot to mention: this only happens on HTTPS, not HTTP. HTTP works fine. Any ideas why HTTPS would be doing this? It gets the first 4K data just fine, just hangs after that and never gets the second or more 4K data.

From: andy.green at linaro.org
To: libwebsockets at ml.libwebsockets.org
Date: Mon, 29 Jun 2015 22:08:58 -0700
Subject: [Libwebsockets] libwebsockets-1.4 HTTP server help with huge http	chunks




Hello,I am trying to host an HTTP server (using the test-server.c sample code). I have a client app that sends big chunks of HTTP data (around 10k-15k) to the server.The server doesn't seem to parse the body fragments well. 
By default libwebsockets delivers data in 4k chunks. This seems to work fine for chunks less than 8k after adding libbwesockets_return_http_status with HTTP_OK after each LWS_CALLBACK_HTTP_BODY message. In the case of less than 8K and greater than 4K, I get two LWS_CALLBACK_HTTP_BODY message, the first with 4k and then the remaining amount in the next message. Then I received the LWS_CALLBACK_HTTP_BODY_COMPLETION message. 
But If I try something bigger than 8k, I never get the 3rd or higher chunk in the BODY Message, and sometimes the whole client app errors out.  I cannot find any sample out there to properly handle large HTTP chunks. I am hoping maybe you guys might have something out there.
Also, changing the rx_buffer_size in the http protocol seems to make no difference.
Thanks for any help!! 		 	   		  

_______________________________________________
Libwebsockets mailing list
Libwebsockets at ml.libwebsockets.org
http://ml.libwebsockets.org/mailman/listinfo/libwebsockets 		 	   		  

_______________________________________________
Libwebsockets mailing list
Libwebsockets at ml.libwebsockets.org
http://ml.libwebsockets.org/mailman/listinfo/libwebsockets 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libwebsockets.org/pipermail/libwebsockets/attachments/20150630/9e8250f3/attachment.html>


More information about the Libwebsockets mailing list