nxt_http_request.c (2133:46433e3cef45) nxt_http_request.c (2139:99d792169ffb)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_router.h>
8#include <nxt_http.h>

--- 16 unchanged lines hidden (view full) ---

25 void *data);
26static void nxt_http_request_done(nxt_task_t *task, void *obj, void *data);
27
28static u_char *nxt_http_date_cache_handler(u_char *buf, nxt_realtime_t *now,
29 struct tm *tm, size_t size, const char *format);
30
31static nxt_http_name_value_t *nxt_http_argument(nxt_array_t *array,
32 u_char *name, size_t name_length, uint32_t hash, u_char *start,
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_router.h>
8#include <nxt_http.h>

--- 16 unchanged lines hidden (view full) ---

25 void *data);
26static void nxt_http_request_done(nxt_task_t *task, void *obj, void *data);
27
28static u_char *nxt_http_date_cache_handler(u_char *buf, nxt_realtime_t *now,
29 struct tm *tm, size_t size, const char *format);
30
31static nxt_http_name_value_t *nxt_http_argument(nxt_array_t *array,
32 u_char *name, size_t name_length, uint32_t hash, u_char *start,
33 u_char *end);
33 const u_char *end);
34static nxt_int_t nxt_http_cookie_parse(nxt_array_t *cookies, u_char *start,
34static nxt_int_t nxt_http_cookie_parse(nxt_array_t *cookies, u_char *start,
35 u_char *end);
35 const u_char *end);
36static nxt_http_name_value_t *nxt_http_cookie(nxt_array_t *array, u_char *name,
36static nxt_http_name_value_t *nxt_http_cookie(nxt_array_t *array, u_char *name,
37 size_t name_length, u_char *start, u_char *end);
37 size_t name_length, u_char *start, const u_char *end);
38
39
40#define NXT_HTTP_COOKIE_HASH \
41 (nxt_http_field_hash_end( \
42 nxt_http_field_hash_char( \
43 nxt_http_field_hash_char( \
44 nxt_http_field_hash_char( \
45 nxt_http_field_hash_char( \

--- 898 unchanged lines hidden (view full) ---

944 r->arguments = args;
945
946 return args;
947}
948
949
950static nxt_http_name_value_t *
951nxt_http_argument(nxt_array_t *array, u_char *name, size_t name_length,
38
39
40#define NXT_HTTP_COOKIE_HASH \
41 (nxt_http_field_hash_end( \
42 nxt_http_field_hash_char( \
43 nxt_http_field_hash_char( \
44 nxt_http_field_hash_char( \
45 nxt_http_field_hash_char( \

--- 898 unchanged lines hidden (view full) ---

944 r->arguments = args;
945
946 return args;
947}
948
949
950static nxt_http_name_value_t *
951nxt_http_argument(nxt_array_t *array, u_char *name, size_t name_length,
952 uint32_t hash, u_char *start, u_char *end)
952 uint32_t hash, u_char *start, const u_char *end)
953{
954 size_t length;
955 nxt_http_name_value_t *nv;
956
957 nv = nxt_array_add(array);
958 if (nxt_slow_path(nv == NULL)) {
959 return NULL;
960 }

--- 52 unchanged lines hidden (view full) ---

1013
1014 r->cookies = cookies;
1015
1016 return cookies;
1017}
1018
1019
1020static nxt_int_t
953{
954 size_t length;
955 nxt_http_name_value_t *nv;
956
957 nv = nxt_array_add(array);
958 if (nxt_slow_path(nv == NULL)) {
959 return NULL;
960 }

--- 52 unchanged lines hidden (view full) ---

1013
1014 r->cookies = cookies;
1015
1016 return cookies;
1017}
1018
1019
1020static nxt_int_t
1021nxt_http_cookie_parse(nxt_array_t *cookies, u_char *start, u_char *end)
1021nxt_http_cookie_parse(nxt_array_t *cookies, u_char *start, const u_char *end)
1022{
1023 size_t name_length;
1024 u_char c, *p, *name;
1025 nxt_http_name_value_t *nv;
1026
1027 name = NULL;
1028 name_length = 0;
1029

--- 32 unchanged lines hidden (view full) ---

1062 }
1063
1064 return NXT_OK;
1065}
1066
1067
1068static nxt_http_name_value_t *
1069nxt_http_cookie(nxt_array_t *array, u_char *name, size_t name_length,
1022{
1023 size_t name_length;
1024 u_char c, *p, *name;
1025 nxt_http_name_value_t *nv;
1026
1027 name = NULL;
1028 name_length = 0;
1029

--- 32 unchanged lines hidden (view full) ---

1062 }
1063
1064 return NXT_OK;
1065}
1066
1067
1068static nxt_http_name_value_t *
1069nxt_http_cookie(nxt_array_t *array, u_char *name, size_t name_length,
1070 u_char *start, u_char *end)
1070 u_char *start, const u_char *end)
1071{
1072 u_char c, *p;
1073 uint32_t hash;
1074 nxt_http_name_value_t *nv;
1075
1076 nv = nxt_array_add(array);
1077 if (nxt_slow_path(nv == NULL)) {
1078 return NULL;

--- 104 unchanged lines hidden ---
1071{
1072 u_char c, *p;
1073 uint32_t hash;
1074 nxt_http_name_value_t *nv;
1075
1076 nv = nxt_array_add(array);
1077 if (nxt_slow_path(nv == NULL)) {
1078 return NULL;

--- 104 unchanged lines hidden ---