[Libwebsockets] two part html

Andy Green andy at warmcat.com
Tue Aug 19 06:13:25 CEST 2014



On 19 August 2014 10:53:37 GMT+08:00, Steve Calfee <scalfee at mqidentity.com> wrote:
>Hi,
>
>I think I can do this, but I am not sure. I would like to send a html
>file with the lws sendfile capability. Then I want to send a string of
>json I built in my app as the rest of the html.
>
>I think all I have to do is when sendfile is done, return 0; then on
>the next http callback I can send my data. If that is true, what
>callback code will I get to indicate it is time for me to send my
>little computed data?

If I understood it, LWS_CALLBACK_HTTP_WRITEABLE.

But you will get trouble I think, if sending the file sets the content length header the transaction is over after that much was sent.

-Andy

>Thanks for the advice, Steve
>_______________________________________________
>Libwebsockets mailing list
>Libwebsockets at ml.libwebsockets.org
>http://ml.libwebsockets.org/mailman/listinfo/libwebsockets




More information about the Libwebsockets mailing list