mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-30 00:00:16 +01:00
fix LWS_NO_SERVER compile
Signed-off-by: John Clark <inidev@gmail.com>
This commit is contained in:
parent
eca0e4913d
commit
9bdcf18e74
1 changed files with 7 additions and 1 deletions
|
@ -58,15 +58,19 @@ libwebsocket_read(struct libwebsocket_context *context,
|
||||||
struct libwebsocket *wsi, unsigned char *buf, size_t len)
|
struct libwebsocket *wsi, unsigned char *buf, size_t len)
|
||||||
{
|
{
|
||||||
size_t n;
|
size_t n;
|
||||||
|
#ifndef LWS_NO_SERVER
|
||||||
struct allocated_headers *ah;
|
struct allocated_headers *ah;
|
||||||
char *uri_ptr = NULL;
|
char *uri_ptr = NULL;
|
||||||
int uri_len = 0;
|
int uri_len = 0;
|
||||||
char content_length_str[32];
|
char content_length_str[32];
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (wsi->state) {
|
switch (wsi->state) {
|
||||||
|
|
||||||
case WSI_STATE_HTTP_BODY:
|
case WSI_STATE_HTTP_BODY:
|
||||||
|
#ifndef LWS_NO_SERVER
|
||||||
http_postbody:
|
http_postbody:
|
||||||
|
#endif
|
||||||
while (len--) {
|
while (len--) {
|
||||||
|
|
||||||
if (wsi->u.http.content_length_seen >= wsi->u.http.content_length)
|
if (wsi->u.http.content_length_seen >= wsi->u.http.content_length)
|
||||||
|
@ -398,9 +402,9 @@ leave:
|
||||||
|
|
||||||
lwsl_parser("accepted v%02d connection\n",
|
lwsl_parser("accepted v%02d connection\n",
|
||||||
wsi->ietf_spec_revision);
|
wsi->ietf_spec_revision);
|
||||||
#endif
|
|
||||||
} /* while all chars are handled */
|
} /* while all chars are handled */
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
case WSI_STATE_AWAITING_CLOSE_ACK:
|
case WSI_STATE_AWAITING_CLOSE_ACK:
|
||||||
case WSI_STATE_ESTABLISHED:
|
case WSI_STATE_ESTABLISHED:
|
||||||
|
@ -435,10 +439,12 @@ leave:
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
#ifndef LWS_NO_SERVER
|
||||||
bail_nuke_ah:
|
bail_nuke_ah:
|
||||||
/* drop the header info */
|
/* drop the header info */
|
||||||
if (wsi->u.hdr.ah)
|
if (wsi->u.hdr.ah)
|
||||||
free(wsi->u.hdr.ah);
|
free(wsi->u.hdr.ah);
|
||||||
|
#endif
|
||||||
|
|
||||||
bail:
|
bail:
|
||||||
lwsl_info("closing connection at libwebsocket_read bail:\n");
|
lwsl_info("closing connection at libwebsocket_read bail:\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue