diff options
author | Igor Sysoev <igor@sysoev.ru> | 2019-10-10 19:37:40 +0300 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2019-10-10 19:37:40 +0300 |
commit | ec0d5c928efcfb2d4958246d686718cb9747f722 (patch) | |
tree | 7db3f61085e0a3adcdcb26e5ebdde16ce4e05f48 /src/nxt_h1proto.c | |
parent | 75453479f3d1d1c865ed2e2a51618dd014642e6f (diff) | |
download | unit-ec0d5c928efcfb2d4958246d686718cb9747f722.tar.gz unit-ec0d5c928efcfb2d4958246d686718cb9747f722.tar.bz2 |
Changed nxt_memcasecmp() interface to avoid casts.
Diffstat (limited to 'src/nxt_h1proto.c')
-rw-r--r-- | src/nxt_h1proto.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nxt_h1proto.c b/src/nxt_h1proto.c index 541fcb44..7602e9c6 100644 --- a/src/nxt_h1proto.c +++ b/src/nxt_h1proto.c @@ -655,8 +655,7 @@ nxt_h1p_header_buffer_test(nxt_task_t *task, nxt_h1proto_t *h1p, nxt_conn_t *c, static nxt_int_t nxt_h1p_connection(void *ctx, nxt_http_field_t *field, uintptr_t data) { - nxt_http_request_t *r; - static const u_char *upgrade = (const u_char *) "upgrade"; + nxt_http_request_t *r; r = ctx; @@ -664,7 +663,7 @@ nxt_h1p_connection(void *ctx, nxt_http_field_t *field, uintptr_t data) r->proto.h1->keepalive = 0; } else if (field->value_length == 7 - && nxt_memcasecmp(field->value, upgrade, 7) == 0) + && nxt_memcasecmp(field->value, "upgrade", 7) == 0) { r->proto.h1->connection_upgrade = 1; } @@ -676,13 +675,12 @@ nxt_h1p_connection(void *ctx, nxt_http_field_t *field, uintptr_t data) static nxt_int_t nxt_h1p_upgrade(void *ctx, nxt_http_field_t *field, uintptr_t data) { - nxt_http_request_t *r; - static const u_char *websocket = (const u_char *) "websocket"; + nxt_http_request_t *r; r = ctx; if (field->value_length == 9 - && nxt_memcasecmp(field->value, websocket, 9) == 0) + && nxt_memcasecmp(field->value, "websocket", 9) == 0) { r->proto.h1->upgrade_websocket = 1; } |