commit ff92a15006d6a937ec05dc070c3cc9bb3217703f
parent 8e7dccc898eefbc70c21b5b1b52d0c81170a731e
Author: Evgeny Grin (Karlson2k) <k2k@drgrin.dev>
Date: Fri, 3 Jul 2026 19:51:38 +0200
Renamed some related response and reply error codes
Diffstat:
5 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/src/include/microhttpd2.h b/src/include/microhttpd2.h
@@ -1310,9 +1310,9 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
MHD_SC_COOKIE_POOL_ALLOCATION_FAILURE = 50220
,
/**
- * MHD failed to build the response header.
+ * MHD failed to build the reply header.
*/
- MHD_SC_REPLY_FAILED_HEADER_GENERATION = 50230
+ MHD_SC_REPLY_HEADER_GENERATION_FAILED = 50230
,
/**
* Failed to allocate memory in connection's pool for the reply.
@@ -1332,7 +1332,7 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
/**
* Failed to allocate memory in connection's pool for the reply.
*/
- MHD_SC_ERR_RESPONSE_ALLOCATION_FAILURE = 50250
+ MHD_SC_REPLY_ALLOCATION_FAILED = 50250
,
/**
* The request POST data cannot be parsed because stream has not enough
@@ -1775,9 +1775,9 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
,
/**
* Unable to clear "reusable" flag.
- * One this flag set, it cannot be removed for the response lifetime.
+ * Once this flag is set, it cannot be removed for the response lifetime.
*/
- MHD_SC_RESP_CANNOT_CLEAR_REUSE = 60300
+ MHD_SC_RESP_REUSABLE_CANNOT_CLEAR = 60300
,
/**
* The response header name has forbidden characters or token
diff --git a/src/include/microhttpd2_preamble.h.in b/src/include/microhttpd2_preamble.h.in
@@ -1310,9 +1310,9 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
MHD_SC_COOKIE_POOL_ALLOCATION_FAILURE = 50220
,
/**
- * MHD failed to build the response header.
+ * MHD failed to build the reply header.
*/
- MHD_SC_REPLY_FAILED_HEADER_GENERATION = 50230
+ MHD_SC_REPLY_HEADER_GENERATION_FAILED = 50230
,
/**
* Failed to allocate memory in connection's pool for the reply.
@@ -1332,7 +1332,7 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
/**
* Failed to allocate memory in connection's pool for the reply.
*/
- MHD_SC_ERR_RESPONSE_ALLOCATION_FAILURE = 50250
+ MHD_SC_REPLY_ALLOCATION_FAILED = 50250
,
/**
* The request POST data cannot be parsed because stream has not enough
@@ -1775,9 +1775,9 @@ enum MHD_FIXED_ENUM_MHD_SET_ MHD_StatusCode
,
/**
* Unable to clear "reusable" flag.
- * One this flag set, it cannot be removed for the response lifetime.
+ * Once this flag is set, it cannot be removed for the response lifetime.
*/
- MHD_SC_RESP_CANNOT_CLEAR_REUSE = 60300
+ MHD_SC_RESP_REUSABLE_CANNOT_CLEAR = 60300
,
/**
* The response header name has forbidden characters or token
diff --git a/src/include/r_options.rec b/src/include/r_options.rec
@@ -28,7 +28,7 @@ CustomSetter: /* custom setter */
+ {
+ if (MHD_NO == option->val.reusable)
+ {
-+ res = MHD_SC_RESP_CANNOT_CLEAR_REUSE;
++ res = MHD_SC_RESP_REUSABLE_CANNOT_CLEAR;
+ i = options_max_num - 1;
+ break;
+ }
diff --git a/src/mhd2/response_set_options.c b/src/mhd2/response_set_options.c
@@ -60,7 +60,7 @@ MHD_response_set_options (
{
if (MHD_NO == option->val.reusable)
{
- res = MHD_SC_RESP_CANNOT_CLEAR_REUSE;
+ res = MHD_SC_RESP_REUSABLE_CANNOT_CLEAR;
i = options_max_num - 1;
break;
}
diff --git a/src/mhd2/stream_funcs.c b/src/mhd2/stream_funcs.c
@@ -792,7 +792,7 @@ mhd_conn_start_closing (struct MHD_Connection *restrict c,
end_code = c->rq.too_large ?
MHD_REQUEST_ENDED_NO_RESOURCES :
MHD_REQUEST_ENDED_HTTP_PROTOCOL_ERROR;
- sc = MHD_SC_ERR_RESPONSE_ALLOCATION_FAILURE;
+ sc = MHD_SC_REPLY_ALLOCATION_FAILED;
break;
case mhd_CONN_CLOSE_APP_ERROR:
close_hard = true;