]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1934913 from trunk:
authorJim Jagielski <jim@apache.org>
Mon, 6 Jul 2026 11:55:01 +0000 (11:55 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 6 Jul 2026 11:55:01 +0000 (11:55 +0000)
Use HTTP_* and ap_is_*() macros instead of literals
Submitted by: michaelo
Reviewed by: rjung, jim, jorton

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935938 13f79535-47bb-0310-9956-ffa450edef68

23 files changed:
modules/aaa/mod_authn_socache.c
modules/cache/mod_cache.c
modules/dav/main/mod_dav.c
modules/dav/main/mod_dav.h
modules/filters/mod_filter.c
modules/generators/cgi_common.h
modules/http2/h2_c2.c
modules/http2/h2_c2_filter.c
modules/http2/h2_headers.c
modules/http2/h2_proxy_session.c
modules/http2/h2_stream.c
modules/http2/h2_ws.c
modules/lua/lua_request.c
modules/mappers/mod_rewrite.c
modules/md/md_acme.c
modules/md/md_curl.c
modules/proxy/mod_proxy_ajp.c
modules/proxy/mod_proxy_ftp.c
modules/proxy/mod_proxy_hcheck.c
modules/proxy/mod_proxy_http.c
server/util_expr_eval.c
test/modules/http1/mod_h1test/mod_h1test.c
test/modules/http2/mod_h2test/mod_h2test.c

index 0834ab43d324375062c1632c7dd6be42a235ae34..be84ca487548e8e4f132cd0f2cfaa9c1bb61a923 100644 (file)
@@ -111,7 +111,7 @@ static int authn_cache_post_config(apr_pool_t *pconf, apr_pool_t *plog,
             ap_log_perror(APLOG_MARK, APLOG_CRIT, 0, plog, APLOGNO(02612)
                         "failed to create mod_socache_shmcb socache "
                         "instance: %s", errmsg);
-            return 500;
+            return 500; /* An HTTP status would be a misnomer! */
         }
     }
 
index 9392e770435220a06c080f881c879c0719e63df5..c69fc3932b03d8bd0e4d2d35b5ad78afdc1b19b7 100644 (file)
@@ -1687,10 +1687,10 @@ static apr_status_t cache_invalidate_filter(ap_filter_t *f,
     }
     else {
 
-        if (r->status > 299) {
+        if (r->status >= HTTP_MULTIPLE_CHOICES) {
 
             ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(02466)
-                    "cache: response status to '%s' method is %d (>299), not invalidating cached entity: %s", r->method, r->status, r->uri);
+                    "cache: response status to '%s' method is %d (>=HTTP_MULTIPLE_CHOICES), not invalidating cached entity: %s", r->method, r->status, r->uri);
 
         }
         else {
index 2625f909cbf308e1bee0d2f243d53b744dfffdf9..6aa0cbe88615afb046a3b98810a4b9316d793901 100644 (file)
@@ -1076,7 +1076,7 @@ static int dav_method_put(request_rec *r)
     if ((err = (*resource->hooks->open_stream)(resource, mode,
                                                &stream)) != NULL) {
         int status = err->status ? err->status : HTTP_FORBIDDEN;
-        if (status > 299) {
+        if (status >= HTTP_MULTIPLE_CHOICES) {
             err = dav_push_error(r->pool, status, 0,
                                  apr_psprintf(r->pool,
                                               "Unable to PUT new contents for %s.",
index 3c1309f6243822205d9f425b65d1432f202c316b..e168db4cdd69103f82cbc4f97fa7d2706ba37263 100644 (file)
@@ -1792,7 +1792,7 @@ DAV_DECLARE_NONSTD(void) dav_prop_exec(dav_prop_ctx *ctx);
 DAV_DECLARE_NONSTD(void) dav_prop_commit(dav_prop_ctx *ctx);
 DAV_DECLARE_NONSTD(void) dav_prop_rollback(dav_prop_ctx *ctx);
 
-#define DAV_PROP_CTX_HAS_ERR(dpc)  ((dpc).err && (dpc).err->status >= 300)
+#define DAV_PROP_CTX_HAS_ERR(dpc)  ((dpc).err && (dpc).err->status >= HTTP_MULTIPLE_CHOICES)
 
 
 /* --------------------------------------------------------------------
index 5b5ecf69712a60aac7b4ce92d6fcc68e43124ffb..fbdb84c2676cdc1f69ead1d7d760a27bb5c12937 100644 (file)
@@ -280,7 +280,7 @@ static apr_status_t filter_harness(ap_filter_t *f, apr_bucket_brigade *bb)
     harness_ctx *ctx = f->ctx;
     ap_filter_rec_t *filter = f->frec;
 
-    if (f->r->status != 200
+    if (f->r->status != HTTP_OK
         && !apr_table_get(f->r->subprocess_env, "filter-errordocs")) {
         ap_remove_output_filter(f);
         return ap_pass_brigade(f->next, bb);
index 66f9418f21ae0b6cd5431338af9665c8c3e7e7e8..175eda3b01ee9a57cff63585fc0368c145f1727d 100644 (file)
@@ -480,7 +480,7 @@ static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb,
 
         location = apr_table_get(r->headers_out, "Location");
 
-        if (location && r->status == 200) {
+        if (location && r->status == HTTP_OK) {
             /* For a redirect whether internal or not, discard any
              * remaining stdout from the script, and log any remaining
              * stderr output, as normal. */
@@ -493,7 +493,7 @@ static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb,
             }
         }
 
-        if (location && location[0] == '/' && r->status == 200) {
+        if (location && location[0] == '/' && r->status == HTTP_OK) {
             /* This redirect needs to be a GET no matter what the original
              * method was.
              */
@@ -509,7 +509,7 @@ static int cgi_handle_response(request_rec *r, int nph, apr_bucket_brigade *bb,
             ap_internal_redirect_handler(location, r);
             return OK;
         }
-        else if (location && r->status == 200) {
+        else if (location && r->status == HTTP_OK) {
             /* XXX: Note that if a script wants to produce its own Redirect
              * body, it now has to explicitly *say* "Status: 302"
              */
index 5a9019aa0cfba170a8b829dd2ea6191f185c8077..3ca6114d470990590723c6f9391b2db5e0027f33 100644 (file)
@@ -395,7 +395,7 @@ static apr_status_t h2_c2_filter_out(ap_filter_t* f, apr_bucket_brigade* bb)
         {
             if (AP_BUCKET_IS_RESPONSE(e)) {
                 ap_bucket_response *resp = e->data;
-                if (resp->status >= 200) {
+                if (resp->status >= HTTP_OK) {
                     conn_ctx->has_final_response = 1;
                     break;
                 }
@@ -461,7 +461,7 @@ static void check_early_hints(request_rec *r, const char *tag)
           }
           old_status = r->status;
           old_line = r->status_line;
-          r->status = 103;
+          r->status = HTTP_EARLY_HINTS;
           r->status_line = "103 Early Hints";
           ap_send_interim_response(r, 1);
           r->status = old_status;
index d770fe91d8397c8b5167adf83b3deb476c49ca0d..17a2c131d8c4a43955ded13d36806d9cea503c4d 100644 (file)
@@ -62,7 +62,7 @@ apr_status_t h2_c2_filter_notes_out(ap_filter_t *f, apr_bucket_brigade *bb)
     {
         if (AP_BUCKET_IS_RESPONSE(b)) {
             resp = b->data;
-            if (resp->status >= 400 && f->r->prev) {
+            if (resp->status >= HTTP_BAD_REQUEST && f->r->prev) {
                 /* Error responses are commonly handled via internal
                  * redirects to error documents. That creates a new
                  * request_rec with 'prev' set to the original.
@@ -547,7 +547,7 @@ static apr_status_t pass_response(h2_conn_ctx_t *conn_ctx, ap_filter_t *f,
     parser->state = H2_RP_STATUS_LINE;
     apr_array_clear(parser->hlines);
 
-    if (response->status >= 200) {
+    if (response->status >= HTTP_OK) {
         conn_ctx->has_final_response = 1;
     }
     ap_log_cerror(APLOG_MARK, APLOG_DEBUG, 0, parser->c,
@@ -657,7 +657,7 @@ apr_status_t h2_c2_filter_catch_h1_out(ap_filter_t* f, apr_bucket_brigade* bb)
                                                        HTTP_INTERNAL_SERVER_ERROR);
                 request_rec *r = h2_create_request_rec(conn_ctx->request, f->c, 1);
                 if (r) {
-                    ap_die((result >= 400)? result : HTTP_INTERNAL_SERVER_ERROR, r);
+                    ap_die((result >= HTTP_BAD_REQUEST)? result : HTTP_INTERNAL_SERVER_ERROR, r);
                     b = ap_bucket_eor_create(f->c->bucket_alloc, r);
                     APR_BRIGADE_INSERT_TAIL(bb, b);
                 }
index d9b3fd09b064bdd659b1c7a2640fa2a4a3e52914..c21a360bbe9c62ed30fd150f9749e49157eb0b80 100644 (file)
@@ -199,7 +199,7 @@ h2_headers *h2_headers_die(apr_status_t type,
     char *date;
     
     headers = apr_pcalloc(pool, sizeof(h2_headers));
-    headers->status    = (type >= 200 && type < 600)? type : 500;
+    headers->status    = (type >= HTTP_OK && type < 600)? type : HTTP_INTERNAL_SERVER_ERROR;
     headers->headers        = apr_table_make(pool, 5);
     headers->notes          = apr_table_make(pool, 5);
 
@@ -213,7 +213,7 @@ h2_headers *h2_headers_die(apr_status_t type,
 
 int h2_headers_are_final_response(h2_headers *headers)
 {
-    return headers->status >= 200;
+    return headers->status >= HTTP_OK;
 }
 
 #endif /* !AP_HAS_RESPONSE_BUCKETS */
index 166b6468f1da9cae6e0b865757c862052b352ec3..f1634eec9b63a9e35bdcd1fcb80c6a2db57a29b2 100644 (file)
@@ -281,24 +281,18 @@ static int on_frame_recv(nghttp2_session *ngh2, const nghttp2_frame *frame,
                 return NGHTTP2_ERR_CALLBACK_FAILURE;
             }
             r = stream->r;
-            if (r->status >= 100 && r->status < 200) {
+            if (ap_is_HTTP_INFO(r->status)) {
                 /* By default, we will forward all interim responses when
                  * we are sitting on a HTTP/2 connection to the client */
                 int forward = session->h2_front;
                 switch(r->status) {
-                    case 100:
+                    case HTTP_CONTINUE:
                         if (stream->waiting_on_100) {
                             stream->waiting_on_100 = 0;
                             r->status_line = ap_get_status_line(r->status);
                             forward = 1;
                         } 
                         break;
-                    case 103:
-                        /* workaround until we get this into http protocol base
-                         * parts. without this, unknown codes are converted to
-                         * 500... */
-                        r->status_line = "103 Early Hints";
-                        break;
                     default:
                         r->status_line = ap_get_status_line(r->status);
                         break;
@@ -311,7 +305,7 @@ static int on_frame_recv(nghttp2_session *ngh2, const nghttp2_frame *frame,
                     ap_send_interim_response(r, 1);
                 }
             }
-            else if (r->status >= 400) {
+            else if (r->status >= HTTP_BAD_REQUEST) {
                 proxy_dir_conf *dconf;
                 dconf = ap_get_module_config(r->per_dir_config, &proxy_module);
                 if (ap_proxy_should_override(dconf, r->status)) {
@@ -417,7 +411,7 @@ static apr_status_t h2_proxy_stream_add_header_out(h2_proxy_stream *stream,
                           stream->session->id, stream->id, s);
             stream->r->status = (int)apr_atoi64(s);
             if (stream->r->status <= 0) {
-                stream->r->status = 500;
+                stream->r->status = HTTP_INTERNAL_SERVER_ERROR;
                 return APR_EGENERAL;
             }
         }
@@ -509,7 +503,7 @@ static void h2_proxy_stream_end_headers_out(h2_proxy_stream *stream)
                                       server_name, portstr)
                        );
     }
-    if (r->status >= 200) stream->headers_ended = 1;
+    if (r->status >= HTTP_OK) stream->headers_ended = 1;
     
     if (APLOGrtrace2(stream->r)) {
         ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, stream->r, 
index f0e671ca5d660a915758431dd91c41c5124f2ef7..653af3fb18cfb0159b56e9037f97cc02cd872771 100644 (file)
@@ -1022,10 +1022,10 @@ static void stream_do_error_bucket(h2_stream *stream, apr_bucket *b)
     int err = ((ap_bucket_error *)(b->data))->status;
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, stream->session->c1,
                   H2_STRM_MSG(stream, "error bucket received, err=%d"), err);
-    if (err >= 500) {
+    if (err >= HTTP_INTERNAL_SERVER_ERROR) {
         err = NGHTTP2_INTERNAL_ERROR;
     }
-    else if (err >= 400) {
+    else if (err >= HTTP_BAD_REQUEST) {
         err = NGHTTP2_STREAM_CLOSED;
     }
     else {
@@ -1649,7 +1649,7 @@ static apr_status_t stream_do_response(h2_stream *stream)
         goto cleanup;
     }
 
-    if (resp->status < 100) {
+    if (resp->status < HTTP_CONTINUE) {
         h2_stream_rst(stream, resp->status);
         goto cleanup;
     }
@@ -1691,8 +1691,8 @@ static apr_status_t stream_do_response(h2_stream *stream)
         && !stream->response
         && stream->request && stream->request->method
         && !strcmp("GET", stream->request->method)
-        && (resp->status < 400)
-        && (resp->status != 304)
+        && (resp->status < HTTP_BAD_REQUEST)
+        && (resp->status != HTTP_NOT_MODIFIED)
         && h2_session_push_enabled(stream->session)) {
         /* PUSH is possible and enabled on server, unless the request
          * denies it, submit resources to push */
@@ -1709,14 +1709,14 @@ static apr_status_t stream_do_response(h2_stream *stream)
     }
     h2_session_set_prio(stream->session, stream, stream->pref_priority);
 
-    if (resp->status == 103
+    if (resp->status == HTTP_EARLY_HINTS
         && !h2_config_sgeti(stream->session->s, H2_CONF_EARLY_HINTS)) {
         /* suppress sending this to the client, it might have triggered
          * pushes and served its purpose nevertheless */
         rv = APR_SUCCESS;
         goto cleanup;
     }
-    if (resp->status >= 200) {
+    if (resp->status >= HTTP_OK) {
         stream->response = resp;
     }
 
index 4643660f3069a3a537c59af986bb94bbd8201450..9e3d5087673fb039caca8d5434d2f3870c5e3cc8 100644 (file)
@@ -247,10 +247,10 @@ static void ws_handle_resp(conn_rec *c2, h2_conn_ctx_t *conn_ctx,
             override_body = is_final = 1;
         }
     }
-    else if (resp->status < 200) {
+    else if (resp->status < HTTP_OK) {
         /* other intermediate response, pass through */
     }
-    else if (resp->status < 300) {
+    else if (resp->status < HTTP_MULTIPLE_CHOICES) {
         /* Failure, we might be talking to a plain http resource */
         ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, c2,
                       "h2_c2(%s-%d): websocket CONNECT, invalid response %d",
index 689780da46e64a83563a0140e4a3446cce1dd6da..8742c43d52d44f220a15a2bbf43ac44bfbcba7d7 100644 (file)
@@ -2209,7 +2209,7 @@ static int lua_websocket_greet(lua_State *L)
         if (encoded_len) {
             encoded = apr_palloc(r->pool, encoded_len);
             encoded_len = apr_base64_encode(encoded, (char*) digest, APR_SHA1_DIGESTSIZE);
-            r->status = 101;
+            r->status = HTTP_SWITCHING_PROTOCOLS;
             apr_table_setn(r->headers_out, "Upgrade", "websocket");
             apr_table_setn(r->headers_out, "Connection", "Upgrade");
             apr_table_setn(r->headers_out, "Sec-WebSocket-Accept", encoded);
@@ -2542,7 +2542,7 @@ APLUA_REQ_TRACE(6)
 APLUA_REQ_TRACE(7)
 APLUA_REQ_TRACE(8)
 
-/* handle r.status = 201 */
+/* handle r.status = HTTP_CREATED */
 static int req_newindex(lua_State *L)
 {
     const char *key;
index f1bc03cb2eef5be9f46e397775367644f237d2d7..80390e984cd53c18300148d4f1ecb6d28b2cc92e 100644 (file)
@@ -4191,7 +4191,7 @@ static cond_return_type apply_rewrite_cond(rewritecond_entry *p, rewrite_ctx *ct
     case CONDPAT_LU_URL:
         if (*input && subreq_ok(r)) {
             rsub = ap_sub_req_lookup_uri(input, r, NULL);
-            if (rsub->status < 400) {
+            if (rsub->status < HTTP_BAD_REQUEST) {
                 rc = COND_RC_MATCH;
             }
             rewritelog(r, 5, NULL, "RewriteCond URI (-U check: "
@@ -4208,7 +4208,7 @@ static cond_return_type apply_rewrite_cond(rewritecond_entry *p, rewrite_ctx *ct
                 return COND_RC_STATUS_SET;
             }
             rsub = ap_sub_req_lookup_file(input, r, NULL);
-            if (rsub->status < 300 &&
+            if (rsub->status < HTTP_MULTIPLE_CHOICES &&
                 /* double-check that file exists since default result is 200 */
                 apr_stat(&sb, rsub->filename, APR_FINFO_MIN,
                          r->pool) == APR_SUCCESS) {
index a62438da4df6bf0a8dd1982e89d0d1dfda8d936b..7c876c62c9e640039717e427601ddd37fc4457bf 100644 (file)
@@ -23,6 +23,8 @@
 #include <apr_hash.h>
 #include <apr_uri.h>
 
+#include <httpd.h>
+
 #include "md.h"
 #include "md_crypt.h"
 #include "md_json.h"
@@ -74,10 +76,10 @@ static acme_problem_status_t Problems[] = {
 static apr_status_t problem_status_get(const char *type) {
     size_t i;
 
-    if (strstr(type, "urn:ietf:params:") == type) {
+    if (ap_strstr_c(type, "urn:ietf:params:") == type) {
         type += strlen("urn:ietf:params:");
     }
-    else if (strstr(type, "urn:") == type) {
+    else if (ap_strstr_c(type, "urn:") == type) {
         type += strlen("urn:");
     }
      
@@ -93,10 +95,10 @@ int md_acme_problem_is_input_related(const char *problem) {
     size_t i;
 
     if (!problem) return 0;
-    if (strstr(problem, "urn:ietf:params:") == problem) {
+    if (ap_strstr_c(problem, "urn:ietf:params:") == problem) {
         problem += strlen("urn:ietf:params:");
     }
-    else if (strstr(problem, "urn:") == problem) {
+    else if (ap_strstr_c(problem, "urn:") == problem) {
         problem += strlen("urn:");
     }
 
@@ -205,12 +207,12 @@ static apr_status_t inspect_problem(md_acme_req_t *req, const md_http_response_t
     }
     
     switch (res->status) {
-        case 400:
+        case HTTP_BAD_REQUEST:
             return APR_EINVAL;
-        case 401: /* sectigo returns this instead of 403 */
-        case 403:
+        case HTTP_UNAUTHORIZED: /* sectigo returns this instead of 403 */
+        case HTTP_FORBIDDEN:
             return APR_EACCES;
-        case 404:
+        case HTTP_NOT_FOUND:
             return APR_ENOENT;
         default:
             md_log_perror(MD_LOG_MARK, MD_LOG_WARNING, 0, req->p,
@@ -282,7 +284,7 @@ static apr_status_t on_response(const md_http_response_t *res, void *data)
     req_update_nonce(req->acme, res->headers);
     
     md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, rv, req->p, "response: %d", res->status);
-    if (res->status >= 200 && res->status < 300) {
+    if (ap_is_HTTP_SUCCESS(res->status)) {
         int processed = 0;
         
         if (req->on_json) {
@@ -687,7 +689,7 @@ static apr_status_t update_directory(const md_http_response_t *res, void *data)
     const char *s;
     
     md_log_perror(MD_LOG_MARK, MD_LOG_TRACE1, 0, req->pool, "directory lookup response: %d", res->status);
-    if (res->status == 503) {
+    if (res->status == HTTP_SERVICE_UNAVAILABLE) {
         md_result_printf(result, APR_EAGAIN,
             "The ACME server at <%s> reports that Service is Unavailable (503). This "
             "may happen during maintenance for short periods of time.", acme->url); 
@@ -695,7 +697,7 @@ static apr_status_t update_directory(const md_http_response_t *res, void *data)
         rv = result->status;
         goto leave;
     }
-    else if (res->status < 200 || res->status >= 300) {
+    else if (res->status < HTTP_OK || res->status >= HTTP_MULTIPLE_CHOICES) {
         md_result_printf(result, APR_EAGAIN,
             "The ACME server at <%s> responded with HTTP status %d. This "
             "is unusual. Please verify that the URL is correct and that you can indeed "
index fac2ab8ec911f57ba74bc11e10be2c0a0f3ae5c2..2484faf51a1f1c5048c108c8b3e284c3d7d61fb9 100644 (file)
@@ -22,6 +22,8 @@
 #include <apr_strings.h>
 #include <apr_buckets.h>
 
+#include <httpd.h>
+
 #include "md.h"
 #include "md_http.h"
 #include "md_log.h"
@@ -168,8 +170,8 @@ static int curlify_headers(void *baton, const char *key, const char *value)
     curlify_hdrs_ctx *ctx = baton;
     const char *s;
     
-    if (strchr(key, '\r') || strchr(key, '\n')
-        || strchr(value, '\r') || strchr(value, '\n')) {
+    if (ap_strchr_c(key, '\r') || ap_strchr_c(key, '\n')
+        || ap_strchr_c(value, '\r') || ap_strchr_c(value, '\n')) {
         ctx->rv = APR_EINVAL;
         return 0;
     }
@@ -273,7 +275,7 @@ static apr_status_t internals_setup(md_http_request_t *req)
         
     internals->response = apr_pcalloc(req->pool, sizeof(md_http_response_t));
     internals->response->req = req;
-    internals->response->status = 400;
+    internals->response->status = HTTP_BAD_REQUEST;
     internals->response->headers = apr_table_make(req->pool, 5);
     internals->response->body = apr_brigade_create(req->pool, req->bucket_alloc);
     
index 356894ab6439e745bc5db7667f2289c9310d026b..6eb57d5cb0ddd51fd2c2d291dff6a5f85b316be5 100644 (file)
@@ -491,7 +491,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
                 if (status != APR_SUCCESS) {
                     backend_failed = 1;
                 }
-                else if ((r->status == 401) && conf->error_override) {
+                else if ((r->status == HTTP_UNAUTHORIZED) && conf->error_override) {
                     const char *buf;
                     const char *wa = "WWW-Authenticate";
                     if ((buf = apr_table_get(r->headers_out, wa))) {
index ad13f7097ecfb933a0074412c51730541faef9ee..b990ee83502bff1770c879da27f8621c5eb3ec45 100644 (file)
@@ -1874,7 +1874,7 @@ static int proxy_ftp_handler(request_rec *r, proxy_worker *worker,
     }
 
     r->status = HTTP_OK;
-    r->status_line = "200 OK";
+    r->status_line = ap_get_status_line(r->status);
 
     apr_rfc822_date(dates, r->request_time);
     apr_table_setn(r->headers_out, "Date", dates);
index 48e8cf903f1bc2d47b7d4b514360ca9b8940a7d5..a4cc03d1c6c67fea3f09766593094ddb0ca381d4 100644 (file)
@@ -909,7 +909,7 @@ static apr_status_t hc_check_http(baton_t *baton, apr_thread_t *thread)
                          hc->s->name_ex, worker->s->name_ex);
             status = !OK;
         }
-    } else if (r->status < 200 || r->status > 399) {
+    } else if (r->status < HTTP_OK || r->status >= HTTP_BAD_REQUEST) {
         ap_log_error(APLOG_MARK, APLOG_TRACE2, 0, ctx->s,
                      "Response status %i for %s (%s): failed", r->status,
                      hc->s->name_ex, worker->s->name_ex);
index 9ab7147a65611537ce424b511159567c546e1e18..eff32f3a09e66045270a646fcb978f629a237f36 100644 (file)
@@ -1389,7 +1389,7 @@ int ap_proxy_http_process_response(proxy_http_req_t *req)
         } else {
             /* an http/0.9 response */
             backasswards = 1;
-            r->status = proxy_status = 200;
+            r->status = proxy_status = HTTP_OK;
             r->status_line = "200 OK";
             backend->close = 1;
         }
index d4cbf92c76ee4f2f3f38603948a90c6eb424e900..a61199beb57462fd47d91f0c9d5b9bb19a6d5bf0 100644 (file)
@@ -1261,7 +1261,7 @@ static int op_url_subr(ap_expr_eval_ctx_t *ctx, const void *data, const char *ar
         return FALSE;
 
     rsub = ap_sub_req_lookup_uri(arg, r, NULL);
-    if (rsub->status < 400) {
+    if (rsub->status < HTTP_BAD_REQUEST) {
             rc = TRUE;
     }
     ap_log_rerror(LOG_MARK(ctx->info), APLOG_TRACE5, 0, r,
@@ -1283,7 +1283,7 @@ static int op_file_subr(ap_expr_eval_ctx_t *ctx, const void *data, const char *a
         return FALSE;
     }
     rsub = ap_sub_req_lookup_file(arg, r, NULL);
-    if (rsub->status < 300 &&
+    if (rsub->status < HTTP_MULTIPLE_CHOICES &&
         /* double-check that file exists since default result is 200 */
         apr_stat(&sb, rsub->filename, APR_FINFO_MIN, ctx->p) == APR_SUCCESS) {
         rc = TRUE;
index cbd87b5b6c197ced9f5a4ea505b2585b2bc6d47d..8c5ac4a42f96b7358124ecb281a44e0128ffa47c 100644 (file)
@@ -60,7 +60,7 @@ static int h1test_echo_handler(request_rec *r)
     }
 
     ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "echo_handler: processing request");
-    r->status = 200;
+    r->status = HTTP_OK;
     r->clength = -1;
     r->chunked = 1;
     ct = apr_table_get(r->headers_in, "content-type");
index f20b9547e7045c87ac587fb2a2452143806b2ac2..59a606b64490440e299594b2e773a29ab767b38b 100644 (file)
@@ -186,7 +186,7 @@ static int h2test_echo_handler(request_rec *r)
     }
 
     ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "echo_handler: processing request");
-    r->status = 200;
+    r->status = HTTP_OK;
     r->clength = -1;
     r->chunked = 1;
     apr_table_unset(r->headers_out, "Content-Length");
@@ -290,7 +290,7 @@ static int h2test_delay_handler(request_rec *r)
 
     ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "delay_handler: processing request, %ds delay",
                   (int)apr_time_sec(delay));
-    r->status = 200;
+    r->status = HTTP_OK;
     r->clength = -1;
     r->chunked = 1;
     apr_table_unset(r->headers_out, "Content-Length");
@@ -373,7 +373,7 @@ static int h2test_trailer_handler(request_rec *r)
 
     ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "trailer_handler: processing request, %d body length",
                   body_len);
-    r->status = 200;
+    r->status = HTTP_OK;
     r->clength = body_len;
     ap_set_content_length(r, body_len);
 
@@ -437,7 +437,7 @@ static int h2test_error_handler(request_rec *r)
     long l;
     apr_time_t delay = 0, body_delay = 0;
     apr_array_header_t *args = NULL;
-    int http_status = 200;
+    int http_status = HTTP_OK;
     apr_status_t error = APR_SUCCESS, body_error = APR_SUCCESS;
 
     if (strcmp(r->handler, "h2test-error")) {