From: Matteo Nastasi (mop) Date: Thu, 28 Jun 2012 16:08:42 +0000 (+0200) Subject: headers via ctrl_socket X-Git-Tag: v0.2.0 X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=commitdiff_plain;h=7507c9fd565badae88b52a27a8ffe82055730c09;p=mod-proxy-fdpass.git headers via ctrl_socket --- diff --git a/mod_proxy_fdpass.c b/mod_proxy_fdpass.c index ff7ddbc..691ca08 100644 --- a/mod_proxy_fdpass.c +++ b/mod_proxy_fdpass.c @@ -283,6 +283,7 @@ static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker, char *headers_out = NULL; int ctrlrawsock[2]; apr_socket_t *ctrlsock = NULL, *clientctrlsock = NULL; + apr_size_t wrlen; if ((headers_out = calloc(8*1024, 1)) != NULL) { apr_table_do(headers_builder, headers_out, r->headers_in, NULL); @@ -375,7 +376,14 @@ static int proxy_fdpass_handler(request_rec *r, proxy_worker *worker, "proxy: FD: send_socket failed:"); return HTTP_INTERNAL_SERVER_ERROR; } - + wrlen = strlen(headers_out); + rv = apr_socket_send(ctrlsock, headers_out, &wrlen); + if (rv != APR_SUCCESS) { + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, + "proxy: FD: send headers failed"); + return HTTP_INTERNAL_SERVER_ERROR; + } + apr_socket_shutdown(ctrlsock, APR_SHUTDOWN_READWRITE); { apr_socket_t *dummy; /* Create a dummy unconnected socket, and set it as the one we were