*/
LWS_VISIBLE int
-lws_read(struct lws *wsi, unsigned char *buf, size_t len)
+lws_read(struct lws *wsi, unsigned char *buf, lws_filepos_t len)
{
unsigned char *last_char, *oldbuf = buf;
- int body_chunk_len;
+ lws_filepos_t body_chunk_len;
size_t n;
lwsl_debug("%s: incoming len %d state %d\n", __func__, (int)len, wsi->state);
}
lwsl_parser("issuing %d bytes to parser\n", (int)len);
- if (lws_handshake_client(wsi, &buf, len))
+ if (lws_handshake_client(wsi, &buf, (size_t)len))
goto bail;
last_char = buf;
- if (lws_handshake_server(wsi, &buf, len))
+ if (lws_handshake_server(wsi, &buf, (size_t)len))
/* Handshake indicates this session is done. */
goto bail;
#endif
n = wsi->protocol->callback(wsi,
LWS_CALLBACK_HTTP_BODY, wsi->user_space,
- buf, body_chunk_len);
+ buf, (size_t)body_chunk_len);
if (n)
goto bail;
- n = body_chunk_len;
+ n = (size_t)body_chunk_len;
#ifdef LWS_WITH_CGI
}
#endif
case LWSS_ESTABLISHED:
case LWSS_AWAITING_CLOSE_ACK:
case LWSS_SHUTDOWN:
- if (lws_handshake_client(wsi, &buf, len))
+ if (lws_handshake_client(wsi, &buf, (size_t)len))
goto bail;
switch (wsi->mode) {
case LWSCM_WS_SERVING:
- if (lws_interpret_incoming_packet(wsi, &buf, len) < 0) {
+ if (lws_interpret_incoming_packet(wsi, &buf, (size_t)len) < 0) {
lwsl_info("interpret_incoming_packet has bailed\n");
goto bail;
}