@@ -73,6 +73,7 @@ ngx_http_rds_json_process_header(ngx_http_request_t *r,
73
73
}
74
74
75
75
ctx -> state = state_done ;
76
+ ctx -> handler = NULL ;
76
77
77
78
/* now we send the postponed response header */
78
79
if (!ctx -> header_sent ) {
@@ -104,6 +105,7 @@ ngx_http_rds_json_process_header(ngx_http_request_t *r,
104
105
}
105
106
106
107
ctx -> state = state_expect_col ;
108
+ ctx -> handler = ngx_http_rds_json_process_col ;
107
109
ctx -> cur_col = 0 ;
108
110
ctx -> col_count = header .col_count ;
109
111
@@ -189,6 +191,7 @@ ngx_http_rds_json_process_col(ngx_http_request_t *r, ngx_chain_t *in,
189
191
dd ("end of column list" );
190
192
191
193
ctx -> state = state_expect_row ;
194
+ ctx -> handler = ngx_http_rds_json_process_row ;
192
195
ctx -> row = 0 ;
193
196
194
197
dd ("output \"[\"" );
@@ -285,6 +288,7 @@ ngx_http_rds_json_process_row(ngx_http_request_t *r, ngx_chain_t *in,
285
288
if (* b -> pos ++ == 0 ) {
286
289
/* end of row list */
287
290
ctx -> state = state_done ;
291
+ ctx -> handler = NULL ;
288
292
289
293
if (b -> pos != b -> last ) {
290
294
ngx_log_error (NGX_LOG_ERR , r -> connection -> log , 0 ,
@@ -318,6 +322,7 @@ ngx_http_rds_json_process_row(ngx_http_request_t *r, ngx_chain_t *in,
318
322
ctx -> row ++ ;
319
323
ctx -> cur_col = 0 ;
320
324
ctx -> state = state_expect_field ;
325
+ ctx -> handler = ngx_http_rds_json_process_field ;
321
326
322
327
if (b -> pos == b -> last ) {
323
328
in = in -> next ;
@@ -417,6 +422,7 @@ ngx_http_rds_json_process_field(ngx_http_request_t *r, ngx_chain_t *in,
417
422
dd ("process field: need to read more field data" );
418
423
419
424
ctx -> state = state_expect_more_field_data ;
425
+ ctx -> handler = ngx_http_rds_json_process_more_field_data ;
420
426
421
427
return ngx_http_rds_json_process_more_field_data (r , in , ctx );
422
428
}
@@ -427,6 +433,7 @@ ngx_http_rds_json_process_field(ngx_http_request_t *r, ngx_chain_t *in,
427
433
dd ("reached the end of the current row" );
428
434
429
435
ctx -> state = state_expect_row ;
436
+ ctx -> handler = ngx_http_rds_json_process_row ;
430
437
431
438
return ngx_http_rds_json_process_row (r , in , ctx );
432
439
}
@@ -494,13 +501,15 @@ ngx_http_rds_json_process_more_field_data(ngx_http_request_t *r,
494
501
dd ("process more field data: reached the end of the current row" );
495
502
496
503
ctx -> state = state_expect_row ;
504
+ ctx -> handler = ngx_http_rds_json_process_row ;
497
505
498
506
return ngx_http_rds_json_process_row (r , in , ctx );
499
507
}
500
508
501
509
dd ("proces more field data: read the next field" );
502
510
503
511
ctx -> state = state_expect_field ;
512
+ ctx -> handler = ngx_http_rds_json_process_field ;
504
513
505
514
return ngx_http_rds_json_process_field (r , in , ctx );
506
515
}
0 commit comments