[Libwebsockets] const char pointer to libwebsocket_write
"Andy Green (林安廸)"
andy at warmcat.com
Sat Feb 15 09:23:41 CET 2014
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