nxt_http_chunk_parse.c (0:a63ceefd6ab0) nxt_http_chunk_parse.c (1:fdc027c56872)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

17 (cs < ((__typeof__(cs)) 1 << (sizeof(cs) * 8 - 4)))
18
19
20static nxt_int_t nxt_http_chunk_buffer(nxt_http_chunk_parse_t *hcp,
21 nxt_buf_t ***tail, nxt_buf_t *in);
22
23
24nxt_buf_t *
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8

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

17 (cs < ((__typeof__(cs)) 1 << (sizeof(cs) * 8 - 4)))
18
19
20static nxt_int_t nxt_http_chunk_buffer(nxt_http_chunk_parse_t *hcp,
21 nxt_buf_t ***tail, nxt_buf_t *in);
22
23
24nxt_buf_t *
25nxt_http_chunk_parse(nxt_http_chunk_parse_t *hcp, nxt_buf_t *in)
25nxt_http_chunk_parse(nxt_task_t *task, nxt_http_chunk_parse_t *hcp,
26 nxt_buf_t *in)
26{
27 u_char c, ch;
28 nxt_int_t ret;
29 nxt_buf_t *b, *out, *nb, **tail;
27{
28 u_char c, ch;
29 nxt_int_t ret;
30 nxt_buf_t *b, *out, *nb, **tail;
30 nxt_thread_t *thr;
31 enum {
32 sw_start = 0,
33 sw_chunk_size,
34 sw_chunk_size_linefeed,
35 sw_chunk_end_newline,
36 sw_chunk_end_linefeed,
37 sw_chunk,
38 } state;

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

163 * It added here just to suppress a warning.
164 */
165 continue;
166 }
167 }
168
169 if (b->retain == 0) {
170 /* No chunk data was found in a buffer. */
31 enum {
32 sw_start = 0,
33 sw_chunk_size,
34 sw_chunk_size_linefeed,
35 sw_chunk_end_newline,
36 sw_chunk_end_linefeed,
37 sw_chunk,
38 } state;

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

163 * It added here just to suppress a warning.
164 */
165 continue;
166 }
167 }
168
169 if (b->retain == 0) {
170 /* No chunk data was found in a buffer. */
171 thr = nxt_thread();
172 nxt_thread_current_work_queue_add(thr, b->completion_handler,
173 b, b->parent, thr->log);
171 nxt_thread_current_work_queue_add(task->thread,
172 b->completion_handler,
173 task, b, b->parent);
174
175 }
176
177 next:
178
179 continue;
180 }
181

--- 82 unchanged lines hidden ---
174
175 }
176
177 next:
178
179 continue;
180 }
181

--- 82 unchanged lines hidden ---