@@ -209,6 +209,14 @@ static ngx_command_t ngx_http_tnt_commands[] = {
209209 offsetof(ngx_http_tnt_loc_conf_t , pure_result ),
210210 & ngx_http_tnt_pass_http_request_masks },
211211
212+ { ngx_string ("tnt_multireturn_skip_count" ),
213+ NGX_HTTP_MAIN_CONF |NGX_HTTP_SRV_CONF
214+ |NGX_HTTP_LOC_CONF |NGX_CONF_TAKE1 ,
215+ ngx_conf_set_size_slot ,
216+ NGX_HTTP_LOC_CONF_OFFSET ,
217+ offsetof(ngx_http_tnt_loc_conf_t , multireturn_skip_count ),
218+ NULL },
219+
212220 { ngx_string ("tnt_http_methods" ),
213221 NGX_HTTP_MAIN_CONF |NGX_HTTP_SRV_CONF |NGX_HTTP_LOC_CONF |NGX_CONF_1MORE ,
214222 ngx_conf_set_bitmask_slot ,
@@ -379,6 +387,7 @@ ngx_http_tnt_create_loc_conf(ngx_conf_t *cf)
379387 conf -> upstream .buffer_size =
380388 conf -> in_multiplier =
381389 conf -> out_multiplier =
390+ conf -> multireturn_skip_count =
382391 conf -> pass_http_request_buffer_size = NGX_CONF_UNSET_SIZE ;
383392
384393 /*
@@ -467,6 +476,9 @@ ngx_http_tnt_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
467476 ngx_conf_merge_bitmask_value (conf -> pure_result , prev -> pure_result ,
468477 NGX_TNT_CONF_OFF );
469478
479+ ngx_conf_merge_size_value (conf -> multireturn_skip_count ,
480+ prev -> multireturn_skip_count , 0 );
481+
470482 if (conf -> headers == NULL ) {
471483 conf -> headers = prev -> headers ;
472484 }
@@ -714,7 +726,8 @@ ngx_http_tnt_send_reply(ngx_http_request_t *r,
714726 return NGX_ERROR ;
715727 }
716728
717- tp_reply_to_json_set_options (& tc , tlcf -> pure_result == NGX_TNT_CONF_ON );
729+ tp_reply_to_json_set_options (& tc , tlcf -> pure_result == NGX_TNT_CONF_ON ,
730+ tlcf -> multireturn_skip_count );
718731
719732 rc = tp_transcode (& tc , (char * )ctx -> tp_cache -> start ,
720733 ctx -> tp_cache -> end - ctx -> tp_cache -> start );
0 commit comments