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:
Jacquin Antoine
2026-03-02 23:50:39 +01:00
parent 887318ba89
commit ae933fcf5a
2 changed files with 15 additions and 16 deletions

View File

@ -1,4 +1,4 @@
%global spec_version 1.0.13
%global spec_version 1.0.14
Name: mod_reqin_log
Version: %{spec_version}
@ -37,14 +37,14 @@ install -m 644 %{_pkgroot}/%{_sysconfdir}/httpd/conf.d/mod_reqin_log.conf %{buil
%doc %{_docdir}/%{name}
%changelog
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.13
- FIX: Remove duplicate comma between query and host fields in JSON output
- FIX: Fix buffer corruption in dynbuf_append by copying null terminator during reallocation
- PACKAGING: Mark config file as %config(noreplace) to preserve user modifications on upgrade
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output
- TEST: Update unit tests to match dynbuf_append fix
* Mon Mar 02 2026 Developer <dev@example.com> - 1.0.14
- REFACTOR: Harmonize JSON field construction - all fields now end with comma
- FIX: Remove duplicate comma between query and host fields
- FIX: Fix buffer corruption in dynbuf_append (copy null terminator)
- PACKAGING: Config file marked as %config(noreplace)
- 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: Add null-termination after buffer reallocation in dynbuf_append
- CHANGE: Remove unparsed_uri, fragment, and content_length fields from JSON output

View File

@ -734,7 +734,6 @@ static void log_request(request_rec *r, reqin_log_config_t *cfg, reqin_log_child
/* timestamp (nanoseconds since epoch) */
{
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);
char ts_buf[32];
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);
}
/* scheme (http or https) */
/* scheme */
dynbuf_append(&buf, "\"scheme\":\"", 10);
append_json_string(&buf, scheme);
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);
dynbuf_append(&buf, "\",", 2);
/* query (query string without leading ?, e.g., foo=bar) */
/* query */
dynbuf_append(&buf, "\"query\":\"", 9);
append_json_string(&buf, query);
dynbuf_append(&buf, "\"", 1);
dynbuf_append(&buf, "\",", 2);
/* host */
dynbuf_append(&buf, ",\"host\":\"", 9);
dynbuf_append(&buf, "\"host\":\"", 8);
append_json_string(&buf, host);
dynbuf_append(&buf, "\",", 2);
/* http_version */
dynbuf_append(&buf, "\"http_version\":\"", 16);
append_json_string(&buf, http_version);
dynbuf_append(&buf, "\"", 1);
dynbuf_append(&buf, "\",", 2);
/* keepalives (number of requests on this connection) */
dynbuf_append(&buf, ",\"keepalives\":", 15);
/* keepalives */
dynbuf_append(&buf, "\"keepalives\":", 13);
{
char ka_buf[16];
snprintf(ka_buf, sizeof(ka_buf), "%d", r->connection->keepalives);