SolidWallOfCode commented on a change in pull request #7445:
URL: https://github.com/apache/trafficserver/pull/7445#discussion_r568170583
##########
File path: iocore/net/ProxyProtocol.cc
##########
@@ -302,6 +307,184 @@ proxy_protocol_v2_parse(ProxyProtocol *pp_info, const
ts::TextView &msg)
return 0;
}
+size_t
+proxy_protocol_v1_build(uint8_t *buf, size_t max_buf_len, const ProxyProtocol
&pp_info)
+{
+ if (max_buf_len < PPv1_CONNECTION_HEADER_LEN_MAX) {
+ return 0;
+ }
+
+ size_t buf_len = 0;
+
+ // preface
+ memcpy(buf, PPv1_CONNECTION_PREFACE.data(), PPv1_CONNECTION_PREFACE.size());
Review comment:
This becomes
```
buf.write(PPv1_CONNECTION_PREFACE).write(' ');
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]