[Libwebsockets] const char pointer to libwebsocket_write
gabriel at gritsch-soft.com
Sat Feb 15 09:26:20 CET 2014
thank you for the fast reply and change in code.
Am 15.02.2014 um 09:23 schrieb Andy Green (林安廸) <andy at warmcat.com>:
> On 15/02/14 16:11, the mail apparently from Gabriel Gritsch included:
>> Hi there,
>> is it save to pass a „const char *“ instead of „char *“ to libwebsocket_write with LWS_WRITE_HTTP parameter?
>> I know it is not with LWS_WRITE_TEXT and LWS_WRITE_BINARY because the bugger is modified but is it also modified with LWS_WRITE_HTTP and I need to create a writable buffer of my const char * data?
>> if it is save, could you add something like this:
>> LWS_EXTERN int
>> libwebsocket_write_http(struct libwebsocket *wsi, const unsigned char *buf, size_t len)
>> libwebsocket_write(wsi, (unsigned char *)buf, len, LWS_WRITE_HTTP);
> Yes it's OK for HTTP protocol.
> Thanks for the idea.
>> best regards
>> Libwebsockets mailing list
>> Libwebsockets at ml.libwebsockets.org
More information about the Libwebsockets