Don't need 'content_remain' in libwebsocket_read
This commit is contained in:
parent
afe26cf4a6
commit
3bb0650e6a
2 changed files with 2 additions and 7 deletions
|
@ -63,7 +63,6 @@ libwebsocket_read(struct libwebsocket_context *context,
|
|||
{
|
||||
size_t n;
|
||||
int body_chunk_len;
|
||||
int content_remain = 0;
|
||||
unsigned char *last_char;
|
||||
|
||||
switch (wsi->state) {
|
||||
|
|
|
@ -177,6 +177,7 @@ int lws_handshake_server(struct libwebsocket_context *context,
|
|||
enum http_connection_type connection_type;
|
||||
int http_version_len;
|
||||
char content_length_str[32];
|
||||
char http_version_str[10];
|
||||
int n;
|
||||
|
||||
/* LWS_CONNMODE_WS_SERVING */
|
||||
|
@ -274,24 +275,20 @@ int lws_handshake_server(struct libwebsocket_context *context,
|
|||
/* Works for single digit HTTP versions. : */
|
||||
http_version_len = lws_hdr_total_length(wsi, WSI_TOKEN_HTTP);
|
||||
if (http_version_len > 7) {
|
||||
char http_version_str[10];
|
||||
lws_hdr_copy(wsi, http_version_str,
|
||||
sizeof(http_version_str) - 1, WSI_TOKEN_HTTP);
|
||||
if (http_version_str[5] == '1' &&
|
||||
http_version_str[7] == '1') {
|
||||
http_version_str[7] == '1')
|
||||
request_version = HTTP_VERSION_1_1;
|
||||
}
|
||||
}
|
||||
wsi->u.http.request_version = request_version;
|
||||
|
||||
/* HTTP/1.1 defaults to "keep-alive", 1.0 to "close" */
|
||||
if (request_version == HTTP_VERSION_1_1)
|
||||
connection_type = HTTP_CONNECTION_KEEP_ALIVE;
|
||||
|
||||
else
|
||||
connection_type = HTTP_CONNECTION_CLOSE;
|
||||
|
||||
|
||||
/* Override default if http "Connection:" header: */
|
||||
if (lws_hdr_total_length(wsi, WSI_TOKEN_CONNECTION)) {
|
||||
char http_conn_str[20];
|
||||
|
@ -328,7 +325,6 @@ int lws_handshake_server(struct libwebsocket_context *context,
|
|||
wsi->user_space, uri_ptr, uri_len);
|
||||
}
|
||||
|
||||
cleanup:
|
||||
/* now drop the header info we kept a pointer to */
|
||||
if (ah)
|
||||
free(ah);
|
||||
|
|
Loading…
Add table
Reference in a new issue