bneradt commented on code in PR #12490:
URL: https://github.com/apache/trafficserver/pull/12490#discussion_r2334101437


##########
src/proxy/logging/LogAccess.cc:
##########
@@ -1940,17 +1940,9 @@ LogAccess::marshal_client_req_url_scheme(char *buf)
     alen = hdrtoken_index_to_length(scheme);
   } else {
     str  = "UNKNOWN";
-    alen = strlen(str);
-  }
-
-  // calculate the padded length only if the actual length
-  // is not zero. We don't want the padded length to be zero
-  // because marshal_mem should write the DEFAULT_STR to the
-  // buffer if str is nil, and we need room for this.
-  //
-  if (alen) {
-    plen = round_strlen(alen + 1); // +1 for trailing 0
+    alen = ::strlen(str);
   }
+  plen = round_strlen(alen + 1); // +1 for trailing 0

Review Comment:
   * The `::` prefix before strlen is the only real production change.
   * I simplified the plen calculation because the preceding logic makes it so 
that alen is always non-empty. This current plen logic was copied from 
elsewhere (the method marshaling) and is not applicable here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to