rb= r->request_body;if(rb->rest == -1) {//第一次执行该函数 rest 设置为请求头的 content-lengthngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log,0,"http request body content length filter"); rb->rest = r->headers_in.content_length_n; }out=NULL; ll= &out;//把in中的所...
在ngx_http_request_body_filter里,有个变量叫做r->headers_in.content_length_n,先把这个变量复习下,最初见它应该是在ngx_http_process_request_header里,headers_in.content_length_n来自于r->headers_in.content_length的取值,而r->headers_in.content_length来自ngx_http_process_unique_header_line,在12章节...
rc= ngx_http_discard_request_body_filter(r, r->header_in);if(rc !=NGX_OK) {returnrc; }if(r->headers_in.content_length_n ==0) {returnNGX_OK; } }/*在接收HTTP头部时,还是要检查是否凑巧已经接收到完整的包体(如果包体很小,那么这是非常可能发生的事),如果已经接收到完整的包 体,则直接返...
ngx_http_postponed_request_t * postponed;//先来看postponed,这个域用来缓存父request的数据(也就是将要发送数据的request) ngx_http_post_subrequest_t * post_subrequest;//这个域保存了子请求的post request,它也就是保存了需要被发送的request. ngx_http_posted_request_t * posted_requests;//这个保存了所...
ngx_str_t http_protocol;//其data成员指向请求中http起始地址 /*表示需要发送给客户端的http响应。out中保存着由headers_out中序列化后的表示http头部的TCP流。 * 在调用ngx_http_output_filter方法后,out中还会保存着待发送的http包体,它是实现异步发送http响应的关键。*/ ...
#define NGX_HTTP_PARSE_INVALID_HEADER 14 /* unused 1 */ // 子请求的输出不会发送到客户端,而是在内存中处理 #define NGX_HTTP_SUBREQUEST_IN_MEMORY 2 // 此标记仅用于ssi filter #define NGX_HTTP_SUBREQUEST_WAITED 4 // 子请求是父请求的完全克隆 ...
We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Cancel Create saved search Sign in Sign up Reseting focus {...
ngx_str_t http_protocol;//其data成员指向请求中http起始地址 /*表示需要发送给客户端的http响应。out中保存着由headers_out中序列化后的表示http头部的TCP流。 * 在调用ngx_http_output_filter方法后,out中还会保存着待发送的http包体,它是实现异步发送http响应的关键。*/ ...
Search or jump to... Search code, repositories, users, issues, pull requests... Provide feedback We read every piece of feedback, and take your input very seriously. Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your...
content_length_n = b->last - b->pos; b->last_buf = 1; rc = ngx_http_send_header(r); if (rc == NGX_ERROR || rc > NGX_OK || r->header_only) { return rc; } return ngx_http_output_filter(r, &out); } static char *ngx_http_set_status(ngx_conf_t *cf, ngx_command_...