Author: michaelo
Date: Wed Jun 3 09:07:51 2026
New Revision: 1934913
Log:
Use HTTP_* and ap_is_*() macros instead of literals
Modified:
httpd/httpd/trunk/include/httpd.h
httpd/httpd/trunk/modules/aaa/mod_authn_socache.c
httpd/httpd/trunk/modules/cache/mod_cache.c
httpd/httpd/trunk/modules/dav/main/mod_dav.c
httpd/httpd/trunk/modules/dav/main/mod_dav.h
httpd/httpd/trunk/modules/filters/mod_filter.c
httpd/httpd/trunk/modules/generators/cgi_common.h
httpd/httpd/trunk/modules/http/http_filters.c
httpd/httpd/trunk/modules/http2/h2_c2.c
httpd/httpd/trunk/modules/http2/h2_c2_filter.c
httpd/httpd/trunk/modules/http2/h2_headers.c
httpd/httpd/trunk/modules/http2/h2_proxy_session.c
httpd/httpd/trunk/modules/http2/h2_stream.c
httpd/httpd/trunk/modules/http2/h2_ws.c
httpd/httpd/trunk/modules/lua/lua_request.c
httpd/httpd/trunk/modules/mappers/mod_rewrite.c
httpd/httpd/trunk/modules/md/md_acme.c
httpd/httpd/trunk/modules/md/md_curl.c
httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c
httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
httpd/httpd/trunk/modules/test/mod_policy.c
httpd/httpd/trunk/server/util_expr_eval.c
httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c
httpd/httpd/trunk/test/modules/http2/mod_h2test/mod_h2test.c
Modified: httpd/httpd/trunk/include/httpd.h
==============================================================================
--- httpd/httpd/trunk/include/httpd.h Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/include/httpd.h Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1161,7 +1161,7 @@ struct request_rec {
* to conclude that no body is there.
*/
unsigned int body_indeterminate :1;
- /** Whether a final (status >= 200) RESPONSE BUCKET has been passed down
+ /** Whether a final (status >= HTTP_OK) RESPONSE BUCKET has been passed down
* the output filters already. Relevant for ap_die().
* TODO: compact elsewhere
*/
Modified: httpd/httpd/trunk/modules/aaa/mod_authn_socache.c
==============================================================================
--- httpd/httpd/trunk/modules/aaa/mod_authn_socache.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/aaa/mod_authn_socache.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -110,7 +110,7 @@ static int authn_cache_post_config(apr_p
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! */
}
}
Modified: httpd/httpd/trunk/modules/cache/mod_cache.c
==============================================================================
--- httpd/httpd/trunk/modules/cache/mod_cache.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/cache/mod_cache.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1687,10 +1687,10 @@ static apr_status_t cache_invalidate_fil
}
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 {
Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.c
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/mod_dav.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/dav/main/mod_dav.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1190,7 +1190,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.",
Modified: httpd/httpd/trunk/modules/dav/main/mod_dav.h
==============================================================================
--- httpd/httpd/trunk/modules/dav/main/mod_dav.h Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/dav/main/mod_dav.h Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1803,7 +1803,7 @@ DAV_DECLARE_NONSTD(void) dav_prop_exec(d
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)
/* --------------------------------------------------------------------
Modified: httpd/httpd/trunk/modules/filters/mod_filter.c
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_filter.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/filters/mod_filter.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -280,7 +280,7 @@ static apr_status_t filter_harness(ap_fi
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);
Modified: httpd/httpd/trunk/modules/generators/cgi_common.h
==============================================================================
--- httpd/httpd/trunk/modules/generators/cgi_common.h Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/generators/cgi_common.h Wed Jun 3 09:07:51 2026 (r1934913)
@@ -485,7 +485,7 @@ static int cgi_handle_response(request_r
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. */
@@ -498,7 +498,7 @@ static int cgi_handle_response(request_r
}
}
- 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.
*/
@@ -514,7 +514,7 @@ static int cgi_handle_response(request_r
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"
*/
Modified: httpd/httpd/trunk/modules/http/http_filters.c
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/http/http_filters.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1216,7 +1216,7 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_
respb = e;
resp = respb->data;
if (!ctx->final_status
- && (resp->status >= 200 || resp->status == HTTP_SWITCHING_PROTOCOLS)) {
+ && (resp->status >= HTTP_OK || resp->status == HTTP_SWITCHING_PROTOCOLS)) {
ctx->final_status = resp->status;
ctx->final_header_only = AP_STATUS_IS_HEADER_ONLY(resp->status);
bcontent = APR_BUCKET_NEXT(e);
@@ -1899,7 +1899,7 @@ static void h1_append_response_head(requ
}
typedef struct h1_response_ctx {
- int final_response_sent; /* strict: a response status >= 200 was sent */
+ int final_response_sent; /* strict: a response status >= HTTP_OK was sent */
int discard_body; /* the response is header only, discard body */
apr_bucket_brigade *tmpbb;
} h1_response_ctx;
@@ -1942,7 +1942,7 @@ apr_status_t ap_h1_response_out_filter(a
ap_log_rerror(APLOG_MARK, APLOG_TRACE2, 0, r,
"ap_h1_response_out_filter seeing response bucket status=%d",
resp->status);
- if (strict && resp->status < 100) {
+ if (strict && resp->status < HTTP_CONTINUE) {
/* error, not a valid http status */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(10386)
"ap_h1_response_out_filter seeing headers "
@@ -1966,8 +1966,8 @@ apr_status_t ap_h1_response_out_filter(a
*/
const char *proto = AP_SERVER_PROTOCOL;
- ctx->final_response_sent = (resp->status >= 200)
- || (!strict && resp->status < 100);
+ ctx->final_response_sent = (resp->status >= HTTP_OK)
+ || (!strict && resp->status < HTTP_CONTINUE);
ctx->discard_body = ctx->final_response_sent &&
(r->header_only || AP_STATUS_IS_HEADER_ONLY(resp->status));
Modified: httpd/httpd/trunk/modules/http2/h2_c2.c
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_c2.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/http2/h2_c2.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -395,7 +395,7 @@ static apr_status_t h2_c2_filter_out(ap_
{
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_re
}
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;
Modified: httpd/httpd/trunk/modules/http2/h2_c2_filter.c
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_c2_filter.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/http2/h2_c2_filter.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -62,7 +62,7 @@ apr_status_t h2_c2_filter_notes_out(ap_f
{
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_con
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(a
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);
}
Modified: httpd/httpd/trunk/modules/http2/h2_headers.c
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_headers.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/http2/h2_headers.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -199,7 +199,7 @@ h2_headers *h2_headers_die(apr_status_t
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
int h2_headers_are_final_response(h2_headers *headers)
{
- return headers->status >= 200;
+ return headers->status >= HTTP_OK;
}
#endif /* !AP_HAS_RESPONSE_BUCKETS */
Modified: httpd/httpd/trunk/modules/http2/h2_proxy_session.c
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_proxy_session.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/http2/h2_proxy_session.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -281,24 +281,18 @@ static int on_frame_recv(nghttp2_session
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
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_
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_
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,
Modified: httpd/httpd/trunk/modules/http2/h2_stream.c
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_stream.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/http2/h2_stream.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1022,10 +1022,10 @@ static void stream_do_error_bucket(h2_st
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(h
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(h
&& !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(h
}
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;
}
Modified: httpd/httpd/trunk/modules/http2/h2_ws.c
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_ws.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/http2/h2_ws.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -247,10 +247,10 @@ static void ws_handle_resp(conn_rec *c2,
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",
Modified: httpd/httpd/trunk/modules/lua/lua_request.c
==============================================================================
--- httpd/httpd/trunk/modules/lua/lua_request.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/lua/lua_request.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -2209,7 +2209,7 @@ static int lua_websocket_greet(lua_State
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;
Modified: httpd/httpd/trunk/modules/mappers/mod_rewrite.c
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_rewrite.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/mappers/mod_rewrite.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -4201,7 +4201,7 @@ static cond_return_type apply_rewrite_co
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: "
@@ -4218,7 +4218,7 @@ static cond_return_type apply_rewrite_co
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) {
Modified: httpd/httpd/trunk/modules/md/md_acme.c
==============================================================================
--- httpd/httpd/trunk/modules/md/md_acme.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/md/md_acme.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -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(con
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_a
}
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
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(con
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(con
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 "
Modified: httpd/httpd/trunk/modules/md/md_curl.c
==============================================================================
--- httpd/httpd/trunk/modules/md/md_curl.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/md/md_curl.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -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,
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_h
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);
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -490,7 +490,7 @@ static int ap_proxy_ajp_request(apr_pool
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))) {
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_ftp.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1870,7 +1870,7 @@ static int proxy_ftp_handler(request_rec
}
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);
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_hcheck.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -906,7 +906,7 @@ static apr_status_t hc_check_http(baton_
hc->s->name, worker->s->name);
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, worker->s->name);
Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_http.c
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_http.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1413,7 +1413,7 @@ int ap_proxy_http_process_response(proxy
} 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;
}
Modified: httpd/httpd/trunk/modules/test/mod_policy.c
==============================================================================
--- httpd/httpd/trunk/modules/test/mod_policy.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/modules/test/mod_policy.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -258,7 +258,7 @@ static apr_status_t policy_length_out_fi
&policy_module);
policy_result result = check_enabled(r, conf, conf->length_action);
- if (result != policy_ignore && r->status >= 200 && r->status < 300
+ if (result != policy_ignore && ap_is_HTTP_SUCCESS(r->status)
&& r->status != HTTP_NO_CONTENT) {
if (!apr_table_get(r->headers_out, "Content-Length")) {
Modified: httpd/httpd/trunk/server/util_expr_eval.c
==============================================================================
--- httpd/httpd/trunk/server/util_expr_eval.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/server/util_expr_eval.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -1650,7 +1650,7 @@ static int op_url_subr(ap_expr_eval_ctx_
return FALSE;
rsub = ap_sub_req_lookup_uri(arg, r, NULL);
- if (rsub->status < 400) {
+ if (rsub->status < HTTP_BAD_REQUEST) {
rc = TRUE;
}
expr_eval_log(ctx, APLOG_TRACE5,
@@ -1672,7 +1672,7 @@ static int op_file_subr(ap_expr_eval_ctx
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;
Modified: httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c
==============================================================================
--- httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/test/modules/http1/mod_h1test/mod_h1test.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -60,7 +60,7 @@ static int h1test_echo_handler(request_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");
Modified: httpd/httpd/trunk/test/modules/http2/mod_h2test/mod_h2test.c
==============================================================================
--- httpd/httpd/trunk/test/modules/http2/mod_h2test/mod_h2test.c Wed Jun 3 08:54:54 2026 (r1934912)
+++ httpd/httpd/trunk/test/modules/http2/mod_h2test/mod_h2test.c Wed Jun 3 09:07:51 2026 (r1934913)
@@ -186,7 +186,7 @@ static int h2test_echo_handler(request_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_
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(reques
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_
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")) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.