LWS_EXTERN int
lws_send_pipe_choked(struct libwebsocket *wsi);
+LWS_EXTERN int
+lws_frame_is_binary(struct libwebsocket *wsi);
+
LWS_EXTERN unsigned char *
libwebsockets_SHA1(const unsigned char *d, size_t n, unsigned char *md);
return c ^ wsi->frame_masking_nonce_04[(wsi->frame_mask_index++) & 3];
}
+/**
+ * lws_frame_is_binary: true if the current frame was sent in binary mode
+ *
+ * @wsi: the connection we are inquiring about
+ *
+ * This is intended to be called from the LWS_CALLBACK_RECEIVE callback if
+ * it's interested to see if the frame it's dealing with was sent in binary
+ * mode.
+ */
+
+int lws_frame_is_binary(struct libwebsocket *wsi)
+{
+ return wsi->frame_is_binary;
+}
int
wsi->rx_user_buffer_head = 0;
return 0;
- case LWS_WS_OPCODE_07__CONTINUATION:
case LWS_WS_OPCODE_07__TEXT_FRAME:
case LWS_WS_OPCODE_07__BINARY_FRAME:
+ wsi->frame_is_binary = wsi->opcode == LWS_WS_OPCODE_07__BINARY_FRAME;
+ case LWS_WS_OPCODE_07__CONTINUATION:
break;
default:
emission on stderr.
</blockquote>
<hr>
+<h2>lws_frame_is_binary - </h2>
+<i>int</i>
+<b>lws_frame_is_binary</b>
+(<i>struct libwebsocket *</i> <b>wsi</b>)
+<h3>Arguments</h3>
+<dl>
+<dt><b>wsi</b>
+<dd>the connection we are inquiring about
+</dl>
+<h3>Description</h3>
+<blockquote>
+This is intended to be called from the LWS_CALLBACK_RECEIVE callback if
+it's interested to see if the frame it's dealing with was sent in binary
+mode.
+</blockquote>
+<hr>
<h2>libwebsockets_remaining_packet_payload - Bytes to come before "overall" rx packet is complete</h2>
<i>size_t</i>
<b>libwebsockets_remaining_packet_payload</b>