diff --git a/README.build b/README.build index 4d23191f8..62de012ff 100644 --- a/README.build +++ b/README.build @@ -147,10 +147,6 @@ They all have reasonable defaults usable for all use-cases except resource- constrained, so you only need to take care about them if you want to tune them to the amount of memory available. - - LWS_MAX_HEADER_NAME_LENGTH default 64: max characters in an HTTP header -name that libwebsockets can cope with, if a header arrives bigger than this -it's ignored until the next header is seen - - LWS_MAX_HEADER_LEN default 1024: allocated area to copy http headers that libwebsockets knows about into. You only need to think about increasing this if your application might have monster length URLs for example, or some other diff --git a/lib/client-handshake.c b/lib/client-handshake.c index e8e497e23..575d03aca 100644 --- a/lib/client-handshake.c +++ b/lib/client-handshake.c @@ -192,7 +192,6 @@ libwebsocket_client_connect(struct libwebsocket_context *context, ietf_version_or_minus_one = SPEC_LATEST_SUPPORTED; wsi->ietf_spec_revision = ietf_version_or_minus_one; - wsi->u.hdr.name_buffer_pos = 0; wsi->user_space = NULL; wsi->state = WSI_STATE_CLIENT_UNCONNECTED; wsi->protocol = NULL; diff --git a/lib/parsers.c b/lib/parsers.c index 8fccdeb4b..e6b0d2412 100644 --- a/lib/parsers.c +++ b/lib/parsers.c @@ -468,21 +468,6 @@ int libwebsocket_parse(struct libwebsocket *wsi, unsigned char c) case WSI_TOKEN_NAME_PART: lwsl_parser("WSI_TOKEN_NAME_PART '%c'\n", c); - if (wsi->u.hdr.name_buffer_pos == - sizeof(wsi->u.hdr.name_buffer) - 1) { - /* did we see HTTP token yet? */ - if (!wsi->u.hdr.ah->frag_index[WSI_TOKEN_GET_URI]) { - lwsl_info("junk before method\n"); - return -1; - } - /* name bigger than we can handle, skip until next */ - wsi->u.hdr.name_buffer_pos = 0; - wsi->u.hdr.parser_state = WSI_TOKEN_SKIPPING; - break; - } - wsi->u.hdr.name_buffer[wsi->u.hdr.name_buffer_pos++] = c; - wsi->u.hdr.name_buffer[wsi->u.hdr.name_buffer_pos] = '\0'; - wsi->u.hdr.lextable_pos = lextable_decode(wsi->u.hdr.lextable_pos, c); @@ -510,7 +495,7 @@ int libwebsocket_parse(struct libwebsocket *wsi, unsigned char c) n = lextable[wsi->u.hdr.lextable_pos] & 0x7f; - lwsl_parser("known hdr '%s'\n", wsi->u.hdr.name_buffer); + lwsl_parser("known hdr %d\n", n); if (n == WSI_TOKEN_GET_URI && wsi->u.hdr.ah->frag_index[WSI_TOKEN_GET_URI]) { @@ -586,7 +571,6 @@ start_fragment: wsi->u.hdr.lextable_pos = 0; } else wsi->u.hdr.parser_state = WSI_TOKEN_SKIPPING; - wsi->u.hdr.name_buffer_pos = 0; break; /* we're done, ignore anything else */ case WSI_PARSING_COMPLETE: diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h index 3b3785b6f..b98b62771 100644 --- a/lib/private-libwebsockets.h +++ b/lib/private-libwebsockets.h @@ -322,8 +322,6 @@ struct allocated_headers { }; struct _lws_header_related { - char name_buffer[LWS_MAX_HEADER_NAME_LENGTH]; - unsigned char name_buffer_pos; struct allocated_headers *ah; int lextable_pos; unsigned char parser_state; /* enum lws_token_indexes */ diff --git a/lib/server.c b/lib/server.c index 72d9e0847..edbcc9789 100644 --- a/lib/server.c +++ b/lib/server.c @@ -100,7 +100,6 @@ libwebsocket_create_new_server_wsi(struct libwebsocket_context *context) /* intialize the instance struct */ new_wsi->state = WSI_STATE_HTTP; - new_wsi->u.hdr.name_buffer_pos = 0; new_wsi->mode = LWS_CONNMODE_HTTP_SERVING; new_wsi->hdr_parsing_completed = 0;