nxt_fastcgi_record_parse.c (0:a63ceefd6ab0) nxt_fastcgi_record_parse.c (1:fdc027c56872)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8
9
10#define NXT_FASTCGI_DATA_MIDDLE 0
11#define NXT_FASTCGI_DATA_END_ON_BORDER 1
12#define NXT_FASTCGI_DATA_END 2
13
14
15static nxt_int_t nxt_fastcgi_buffer(nxt_fastcgi_parse_t *fp, nxt_buf_t ***tail,
16 nxt_buf_t *in);
17
18
19void
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) NGINX, Inc.
5 */
6
7#include <nxt_main.h>
8
9
10#define NXT_FASTCGI_DATA_MIDDLE 0
11#define NXT_FASTCGI_DATA_END_ON_BORDER 1
12#define NXT_FASTCGI_DATA_END 2
13
14
15static nxt_int_t nxt_fastcgi_buffer(nxt_fastcgi_parse_t *fp, nxt_buf_t ***tail,
16 nxt_buf_t *in);
17
18
19void
20nxt_fastcgi_record_parse(nxt_fastcgi_parse_t *fp, nxt_buf_t *in)
20nxt_fastcgi_record_parse(nxt_task_t *task, nxt_fastcgi_parse_t *fp,
21 nxt_buf_t *in)
21{
22 u_char ch;
23 nxt_int_t ret, stream;
24 nxt_buf_t *b, *nb, **tail[2];
25 const char *msg;
22{
23 u_char ch;
24 nxt_int_t ret, stream;
25 nxt_buf_t *b, *nb, **tail[2];
26 const char *msg;
26 nxt_thread_t *thr;
27 enum {
28 sw_fastcgi_version = 0,
29 sw_fastcgi_type,
30 sw_fastcgi_request_id_high,
31 sw_fastcgi_request_id_low,
32 sw_fastcgi_content_length_high,
33 sw_fastcgi_content_length_low,
34 sw_fastcgi_padding_length,

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

203 nxt_thread_log_debug("fastcgi end request");
204
205 goto done;
206 }
207 }
208
209 if (b->retain == 0) {
210 /* No record data was found in a buffer. */
27 enum {
28 sw_fastcgi_version = 0,
29 sw_fastcgi_type,
30 sw_fastcgi_request_id_high,
31 sw_fastcgi_request_id_low,
32 sw_fastcgi_content_length_high,
33 sw_fastcgi_content_length_low,
34 sw_fastcgi_padding_length,

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

203 nxt_thread_log_debug("fastcgi end request");
204
205 goto done;
206 }
207 }
208
209 if (b->retain == 0) {
210 /* No record data was found in a buffer. */
211 thr = nxt_thread();
212 nxt_thread_current_work_queue_add(thr, b->completion_handler,
213 b, b->parent, thr->log);
211 nxt_thread_current_work_queue_add(task->thread,
212 b->completion_handler,
213 task, b, b->parent);
214 }
215
216 next:
217
218 continue;
219 }
220
221 fp->state = state;

--- 86 unchanged lines hidden ---
214 }
215
216 next:
217
218 continue;
219 }
220
221 fp->state = state;

--- 86 unchanged lines hidden ---