diff --git a/src/deps/libuwsockets.cpp b/src/deps/libuwsockets.cpp index d542b7ecbc..271794019f 100644 --- a/src/deps/libuwsockets.cpp +++ b/src/deps/libuwsockets.cpp @@ -488,15 +488,17 @@ uws_sendstatus_t uws_ws_send_with_options(int ssl, uws_websocket_t *ws, if (ssl) { uWS::WebSocket *uws = (uWS::WebSocket *)ws; - return (uws_sendstatus_t)uws->send(std::string_view(message), + return (uws_sendstatus_t)uws->send(std::string_view(message, length), + (uWS::OpCode)(unsigned char)opcode, + compress, fin); + } else { + + uWS::WebSocket *uws = + (uWS::WebSocket *)ws; + return (uws_sendstatus_t)uws->send(std::string_view(message, length), (uWS::OpCode)(unsigned char)opcode, compress, fin); } - uWS::WebSocket *uws = - (uWS::WebSocket *)ws; - return (uws_sendstatus_t)uws->send(std::string_view(message), - (uWS::OpCode)(unsigned char)opcode, - compress, fin); } uws_sendstatus_t uws_ws_send_fragment(int ssl, uws_websocket_t *ws, @@ -520,12 +522,12 @@ uws_sendstatus_t uws_ws_send_first_fragment(int ssl, uws_websocket_t *ws, uWS::WebSocket *uws = (uWS::WebSocket *)ws; return (uws_sendstatus_t)uws->sendFirstFragment( - std::string_view(message), uWS::OpCode::BINARY, compress); + std::string_view(message, length), uWS::OpCode::BINARY, compress); } uWS::WebSocket *uws = (uWS::WebSocket *)ws; return (uws_sendstatus_t)uws->sendFirstFragment( - std::string_view(message), uWS::OpCode::BINARY, compress); + std::string_view(message, length), uWS::OpCode::BINARY, compress); } uws_sendstatus_t uws_ws_send_first_fragment_with_opcode(int ssl, uws_websocket_t *ws,