[Libwebsockets] fail uploading file

Avigail Wilk awilk at kramerav.com
Sun Jun 27 10:15:46 CEST 2021


My code is failing to upload files via http post request. I was able to reproduce it with lws-minimal-http-server-form-post-file.

I changed lws-minimal-http-server-form-post-file as follows: (in order to make it as similar to my project)

I added ssl and made the post url ("/form1") be served manually with LWSMPRO_CALLBACK.

These changes made no problems.

But when I added In LWS_CALLBACK_HTTP_WRITEABLE a write to the socket with lws_write the post request (the upload) on files larger than 4080 bytes fails.

Is there an issue calling lws_write before finishing a post request when getting a callback LWS_CALLBACK_HTTP_WRITEABLE ?

I'm attaching the code with the changes of lws-minimal-http-server-form-post-file example.

Thanks a lot!

This message has been scanned for malware by Websense. www.websense.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20210627/2bf5d58b/attachment-0001.htm>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: minimal-form-post-file-fail.txt
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20210627/2bf5d58b/attachment-0001.txt>

More information about the Libwebsockets mailing list