diff --git a/native/include/mod_proxy_cluster.h b/native/include/mod_proxy_cluster.h index 36013a61..cc38a456 100644 --- a/native/include/mod_proxy_cluster.h +++ b/native/include/mod_proxy_cluster.h @@ -43,7 +43,7 @@ struct balancer_method * @param r request_rec structure * @param id ident of the worker * @param load load factor to set if test is ok - * @return 0: All OK 500 : Error + * @return 0 in case of success, HTTP_INTERNAL_SERVER_ERROR otherwise */ int (*proxy_node_isup)(request_rec *r, int id, int load); /** @@ -52,7 +52,7 @@ struct balancer_method * @param scheme something like ajp, http or https * @param host the hostname * @param port the port on which the node connector is running - * @return 0: All OK 500 : Error + * @return 0 in case of success, HTTP_INTERNAL_SERVER_ERROR otherwise */ int (*proxy_host_isup)(request_rec *r, const char *scheme, const char *host, const char *port); /** diff --git a/native/mod_manager/mod_manager.c b/native/mod_manager/mod_manager.c index 8f8e6864..37fc7a7e 100644 --- a/native/mod_manager/mod_manager.c +++ b/native/mod_manager/mod_manager.c @@ -3411,7 +3411,7 @@ static int manager_handler(request_rec *r) if (status != APR_SUCCESS) { process_error(r, apr_psprintf(r->pool, SREADER, r->method), TYPESYNTAX); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } buff[bufsiz] = '\0'; @@ -3422,7 +3422,7 @@ static int manager_handler(request_rec *r) ptr = process_buff(r, buff); if (ptr == NULL) { process_error(r, SMESPAR, TYPESYNTAX); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } if (strstr(r->filename, NODE_COMMAND)) { global = 1; @@ -3450,7 +3450,7 @@ static int manager_handler(request_rec *r) /* Check error string and build the error message */ if (errstring) { process_error(r, errstring, errtype); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "manager_handler: %s OK", r->method); diff --git a/native/mod_proxy_cluster/mod_proxy_cluster.c b/native/mod_proxy_cluster/mod_proxy_cluster.c index 8d3dfd1e..37e5c039 100644 --- a/native/mod_proxy_cluster/mod_proxy_cluster.c +++ b/native/mod_proxy_cluster/mod_proxy_cluster.c @@ -1844,10 +1844,10 @@ static int proxy_node_isup(request_rec *r, int id, int load) char *ptr; if (node_storage->read_node(id, &node) != APR_SUCCESS) { - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } if (node->mess.remove) { - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } /* Calculate the address of our shared memory that corresponds to the stat info of the worker */ @@ -1875,7 +1875,7 @@ static int proxy_node_isup(request_rec *r, int id, int load) if (worker == NULL) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_cluster_isup: Can't find worker for %d. Check balancer names.", id); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } /* Try a ping/pong to check the node */ @@ -1887,7 +1887,7 @@ static int proxy_node_isup(request_rec *r, int id, int load) if (worker->s->status & PROXY_WORKER_NOT_USABLE_BITMAP) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_cluster_isup: health check says PROXY_WORKER_IN_ERROR"); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_cluster_isup: health check says OK"); @@ -1904,7 +1904,7 @@ static int proxy_node_isup(request_rec *r, int id, int load) if (proxy_cluster_try_pingpong(r, worker, url, conf, node->mess.ping, node->mess.timeout) != APR_SUCCESS) { worker->s->status |= PROXY_WORKER_IN_ERROR; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_cluster_isup: pingpong %s failed", url); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } } } @@ -1936,19 +1936,19 @@ static int proxy_host_isup(request_rec *r, const char *scheme, const char *host, rv = apr_socket_create(&sock, APR_INET, SOCK_STREAM, 0, r->pool); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, 0, r->server, "proxy_host_isup: pingpong (apr_socket_create) failed"); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } rv = apr_sockaddr_info_get(&to, host, APR_INET, nport, 0, r->pool); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, 0, r->server, "proxy_host_isup: pingpong (apr_sockaddr_info_get(%s, %d)) failed", host, nport); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } rv = apr_socket_connect(sock, to); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_host_isup: pingpong (apr_socket_connect) failed"); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } /* XXX: For the moment we support only AJP */ @@ -1956,7 +1956,7 @@ static int proxy_host_isup(request_rec *r, const char *scheme, const char *host, rv = ajp_handle_cping_cpong(sock, r, apr_time_from_sec(10)); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy_host_isup: cping_cpong failed"); - return 500; + return HTTP_INTERNAL_SERVER_ERROR; } } else { ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, r->server, "proxy_host_isup: %s no yet supported", scheme);