From: Takashi Sato Date: Tue, 10 Jun 2014 11:21:22 +0000 (+0000) Subject: * apr_status_t vs HTTP status code fix X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8152e1de0569f53d1ce84f0e603da564749b9465;p=thirdparty%2Fapache%2Fhttpd.git * apr_status_t vs HTTP status code fix * use APR_STATUS_IS_ENOTIMPL rather than direct comparison git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1601604 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_wstunnel.c b/modules/proxy/mod_proxy_wstunnel.c index 398b60f962b..3939df2fa28 100644 --- a/modules/proxy/mod_proxy_wstunnel.c +++ b/modules/proxy/mod_proxy_wstunnel.c @@ -36,7 +36,7 @@ typedef struct ws_baton_t { char *scheme; /* required to release the proxy connection */ } ws_baton_t; -static int proxy_wstunnel_transfer(request_rec *r, conn_rec *c_i, conn_rec *c_o, +static apr_status_t proxy_wstunnel_transfer(request_rec *r, conn_rec *c_i, conn_rec *c_o, apr_bucket_brigade *bb, char *name); static void proxy_wstunnel_callback(void *b); @@ -259,10 +259,10 @@ static int proxy_wstunnel_canon(request_rec *r, char *url) } -static int proxy_wstunnel_transfer(request_rec *r, conn_rec *c_i, conn_rec *c_o, +static apr_status_t proxy_wstunnel_transfer(request_rec *r, conn_rec *c_i, conn_rec *c_o, apr_bucket_brigade *bb, char *name) { - int rv; + apr_status_t rv; #ifdef DEBUGGING apr_off_t len; #endif @@ -432,20 +432,20 @@ static int proxy_wstunnel_request(apr_pool_t *p, request_rec *r, if (status == SUSPENDED) { sockets[0] = baton->client_soc; sockets[1] = baton->server_soc; - status = ap_mpm_register_socket_callback_timeout(sockets, baton->subpool, 1, + rv = ap_mpm_register_socket_callback_timeout(sockets, baton->subpool, 1, proxy_wstunnel_callback, proxy_wstunnel_cancel_callback, baton, dconf->idle_timeout); - if (status == APR_SUCCESS) { + if (rv == APR_SUCCESS) { return SUSPENDED; } - else if (status == APR_ENOTIMPL) { + else if (APR_STATUS_IS_ENOTIMPL(rv)) { ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, APLOGNO(02544) "No async support"); status = proxy_wstunnel_pump(baton, dconf->idle_timeout, 0); /* force no async */ } else { - ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r, + ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(02543) "error creating websockets tunnel"); return HTTP_INTERNAL_SERVER_ERROR; }