mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
ss: ws: observe TEXT and BINARY from policy when sending SS ws
This commit is contained in:
parent
beacbbb38c
commit
648e25e9a8
1 changed files with 4 additions and 3 deletions
|
@ -123,12 +123,13 @@ secstream_ws(struct lws *wsi, enum lws_callback_reasons reason, void *user,
|
|||
break;
|
||||
}
|
||||
|
||||
f1 = lws_write_ws_flags(LWS_WRITE_BINARY,
|
||||
f1 = lws_write_ws_flags(h->policy->u.http.u.ws.binary ?
|
||||
LWS_WRITE_BINARY : LWS_WRITE_TEXT,
|
||||
!!(f & LWSSS_FLAG_SOM),
|
||||
!!(f & LWSSS_FLAG_EOM));
|
||||
|
||||
if (lws_write(wsi, buf + LWS_PRE, buflen, f1) != (int)buflen) {
|
||||
lwsl_err("%s: write failed\n", __func__);
|
||||
if (lws_write(wsi, buf + LWS_PRE, buflen, f1) < (int)buflen) {
|
||||
lwsl_info("%s: write failed\n", __func__);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue