Github user SolidWallOfCode commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/1007#discussion_r78400907
  
    --- Diff: iocore/net/P_UnixNetVConnection.h ---
    @@ -170,6 +170,38 @@ class UnixNetVConnection : public NetVConnection
       /////////////////////////////////////////////////////////////////
       UnixNetVConnection();
     
    +  int
    +  populate_protocol(char const **results, int n) const
    +  {
    +    int retval = 0;
    +    if (n > 0) {
    +      results[0] = options.get_proto_string();
    +      retval++;
    +      if (n > 1) {
    +        results[1] = options.get_family_string();
    +        retval++;
    +      }
    +    }
    +    return retval;
    +  }
    +
    +  const char *
    +  protocol_contains(const char *tag) const
    +  {
    +    const char *retval   = NULL;
    +    unsigned int tag_len = strlen(tag);
    +    const char *test_tag = options.get_proto_string();
    +    if (tag_len <= strlen(test_tag) && strncmp(tag, test_tag, tag_len) == 
0) {
    --- End diff --
    
    Don't need to do the `strlen`, `strncmp` will stop (and fail) if the 
protocol tag has a null termination.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to