Forum: NGINX Help, make a post subrequest with response body from parent

2974d09ac2541e892966b762aad84943?d=identicon&s=25 honwel (Guest)
on 2014-04-09 08:45
(Received via mailing list)
hi, angentzh

    I use echo module(angentzh) to issue a subrequest(POST method) that
it's
body from parent's request body,  and i add some code in
ngx_http_echo_subrequest->ngx_http_echo_parse_subrequest_spec :
   so, it's not work, but change to '-b' or '-f', it's OK. help ?


........................
             if (ngx_strncmp("-h", arg->data, arg->len) == 0) {   // add
'-h' param
275                 to_write = &h_str;
276                 expecting_opt = 0;
277                 continue;
278             }
279         }
280
281         ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
282                       "unknown option for echo_subrequest_async:
%V",
arg);
283
284         return NGX_ERROR;
285     }
286
287     if (h_str != NULL && h_str->len) {
288         parsed_sr->query_string = &r->args;
289         if (r->request_body == NULL) {
290             return NGX_ERROR;
291         }
292
293         rb = r->request_body;                               // make
post
body from parent's body,  is right?
               // i track this line by gdb, the r->request_body->buf is
null, and r->request_body->bufs aslo is null.
294
295     } else if (body_str != NULL && body_str->len) {
296         rb = ngx_pcalloc(r->pool, sizeof(ngx_http_request_body_t));
297
298         if (rb == NULL) {

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,249140,249140#msg-249140
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.