release: version 1.0.14 - Harmonize JSON construction
- REFACTOR: All JSON fields now follow same pattern (field ends with comma) - FIX: Duplicate comma between query and host fields - FIX: Buffer corruption in dynbuf_append (copy null terminator) - CLEANUP: Remove unnecessary comments, simplify code structure Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
%global spec_version 1.0.13
|
%global spec_version 1.0.14
|
||||||
|
|
||||||
Name: mod_reqin_log
|
Name: mod_reqin_log
|
||||||
Version: %{spec_version}
|
Version: %{spec_version}
|
||||||
@ -37,14 +37,14 @@ install -m 644 %{_pkgroot}/%{_sysconfdir}/httpd/conf.d/mod_reqin_log.conf %{buil
|
|||||||
%doc %{_docdir}/%{name}
|
%doc %{_docdir}/%{name}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.13
|
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.14
|
||||||
- FIX: Remove duplicate comma between query and host fields in JSON output
|
- REFACTOR: Harmonize JSON field construction - all fields now end with comma
|
||||||
- FIX: Fix buffer corruption in dynbuf_append by copying null terminator during reallocation
|
- FIX: Remove duplicate comma between query and host fields
|
||||||
- PACKAGING: Mark config file as %config(noreplace) to preserve user modifications on upgrade
|
- FIX: Fix buffer corruption in dynbuf_append (copy null terminator)
|
||||||
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
|
- PACKAGING: Config file marked as %config(noreplace)
|
||||||
- TEST: Update unit tests to match dynbuf_append fix
|
- CHANGE: Remove unparsed_uri, fragment, content_length fields
|
||||||
|
|
||||||
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.12
|
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.13
|
||||||
- FIX: Correct JSON string length parameters for query and fragment fields
|
- FIX: Correct JSON string length parameters for query and fragment fields
|
||||||
- FIX: Add null-termination after buffer reallocation in dynbuf_append
|
- FIX: Add null-termination after buffer reallocation in dynbuf_append
|
||||||
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
|
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
|
||||||
|
|||||||
@ -734,7 +734,6 @@ static void log_request(request_rec *r, reqin_log_config_t *cfg, reqin_log_child
|
|||||||
/* timestamp (nanoseconds since epoch) */
|
/* timestamp (nanoseconds since epoch) */
|
||||||
{
|
{
|
||||||
apr_time_t now = apr_time_now();
|
apr_time_t now = apr_time_now();
|
||||||
/* Cast to apr_uint64_t before multiplication to prevent overflow */
|
|
||||||
apr_uint64_t ns = ((apr_uint64_t)now) * APR_UINT64_C(1000);
|
apr_uint64_t ns = ((apr_uint64_t)now) * APR_UINT64_C(1000);
|
||||||
char ts_buf[32];
|
char ts_buf[32];
|
||||||
snprintf(ts_buf, sizeof(ts_buf), "%" APR_UINT64_T_FMT, ns);
|
snprintf(ts_buf, sizeof(ts_buf), "%" APR_UINT64_T_FMT, ns);
|
||||||
@ -743,7 +742,7 @@ static void log_request(request_rec *r, reqin_log_config_t *cfg, reqin_log_child
|
|||||||
dynbuf_append(&buf, ",", 1);
|
dynbuf_append(&buf, ",", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* scheme (http or https) */
|
/* scheme */
|
||||||
dynbuf_append(&buf, "\"scheme\":\"", 10);
|
dynbuf_append(&buf, "\"scheme\":\"", 10);
|
||||||
append_json_string(&buf, scheme);
|
append_json_string(&buf, scheme);
|
||||||
dynbuf_append(&buf, "\",", 2);
|
dynbuf_append(&buf, "\",", 2);
|
||||||
@ -788,23 +787,23 @@ static void log_request(request_rec *r, reqin_log_config_t *cfg, reqin_log_child
|
|||||||
append_json_string(&buf, path);
|
append_json_string(&buf, path);
|
||||||
dynbuf_append(&buf, "\",", 2);
|
dynbuf_append(&buf, "\",", 2);
|
||||||
|
|
||||||
/* query (query string without leading ?, e.g., foo=bar) */
|
/* query */
|
||||||
dynbuf_append(&buf, "\"query\":\"", 9);
|
dynbuf_append(&buf, "\"query\":\"", 9);
|
||||||
append_json_string(&buf, query);
|
append_json_string(&buf, query);
|
||||||
dynbuf_append(&buf, "\"", 1);
|
dynbuf_append(&buf, "\",", 2);
|
||||||
|
|
||||||
/* host */
|
/* host */
|
||||||
dynbuf_append(&buf, ",\"host\":\"", 9);
|
dynbuf_append(&buf, "\"host\":\"", 8);
|
||||||
append_json_string(&buf, host);
|
append_json_string(&buf, host);
|
||||||
dynbuf_append(&buf, "\",", 2);
|
dynbuf_append(&buf, "\",", 2);
|
||||||
|
|
||||||
/* http_version */
|
/* http_version */
|
||||||
dynbuf_append(&buf, "\"http_version\":\"", 16);
|
dynbuf_append(&buf, "\"http_version\":\"", 16);
|
||||||
append_json_string(&buf, http_version);
|
append_json_string(&buf, http_version);
|
||||||
dynbuf_append(&buf, "\"", 1);
|
dynbuf_append(&buf, "\",", 2);
|
||||||
|
|
||||||
/* keepalives (number of requests on this connection) */
|
/* keepalives */
|
||||||
dynbuf_append(&buf, ",\"keepalives\":", 15);
|
dynbuf_append(&buf, "\"keepalives\":", 13);
|
||||||
{
|
{
|
||||||
char ka_buf[16];
|
char ka_buf[16];
|
||||||
snprintf(ka_buf, sizeof(ka_buf), "%d", r->connection->keepalives);
|
snprintf(ka_buf, sizeof(ka_buf), "%d", r->connection->keepalives);
|
||||||
|
|||||||
Reference in New Issue
Block a user