This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 7dc5ba4b15 CID 1508894: Traffic Dump restore ostream format (#10503)
7dc5ba4b15 is described below

commit 7dc5ba4b15c5736c01c3bb0a71455762eee42145
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Sep 25 10:34:48 2023 -0500

    CID 1508894: Traffic Dump restore ostream format (#10503)
    
    Traffic Dump: This restores the ostream format after temporarilly
    changing it for a particular string of output.
    
    Fixes: #10423
---
 plugins/traffic_dump/json_utils.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/plugins/traffic_dump/json_utils.cc 
b/plugins/traffic_dump/json_utils.cc
index 16b7aad98e..a01c340057 100644
--- a/plugins/traffic_dump/json_utils.cc
+++ b/plugins/traffic_dump/json_utils.cc
@@ -115,8 +115,10 @@ esc_json_out(const char *buf, int64_t len, std::ostream 
&jsonfile)
     }
     default: {
       if (c <= '\x1f') {
+        auto const original_flags = jsonfile.flags();
         write_buffered_context(buf, prevIdx, idx, jsonfile);
         jsonfile << "\\u" << std::hex << std::setw(4) << std::setfill('0') << 
static_cast<int>(c);
+        jsonfile.flags(original_flags);
       }
       break;
       // else: The character does not need to be escaped. Do not call

Reply via email to