Sage-2001 commented on code in PR #9678:
URL: https://github.com/apache/trafficserver/pull/9678#discussion_r1186634138


##########
doc/developer-guide/api/functions/TSUrlHostGet.en.rst:
##########
@@ -52,6 +52,10 @@ buffers. The URL functions can create, copy, retrieve or 
delete entire URLs,
 and retrieve or modify parts of URLs, such as their host, port or scheme
 information.
 
+    TSMBufferCreate(...)
+    TSUrlParse(...)
+    TSUrlHostGet(...)

Review Comment:
   The current issue at hand indicates the inclusion of a specific note in the 
document. The note emphasizes that the function TSUrlHostGet can only be 
invoked subsequent to the TS_HTTP_POST_REMAP_HOOK stage. However, during the 
TS_HTTP_READ_REQUEST_HDR_HOOK phase, one can make use of the TSHttpHdrHostGet 
function to retrieve the host information if required.
   
   In response to this issue, jpeach suggested incorporating a condition for 
calling TSUrlHostGet into the document, as expressed in #5742. According to 
jpeach, TSUrlHostGet receives a URL from a marshal buffer, and as long as the 
buffer contains the necessary host portion, the function should function 
correctly.
   
   To implement this, the following steps can be taken:
   
   1. Create a TSMBuffer instance using the TSMBufferCreate() function.
   2. Parse the URL using the TSUrlParse() function.
   3. Retrieve the host using the TSUrlHostGet() function.
   Therefore, to address the issue, I modified the code as follows:
   
   TSMBufferCreate(...);
   TSUrlParse(...);
   TSUrlHostGet(...);
   
   By making these modifications, the code will adhere to the suggested 
approach while maintaining a professional and easily understandable format for 
your reviewer.
   
   Reference :- https://github.com/apache/trafficserver/issues/5742



-- 
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