> On Nov. 6, 2014, 5:44 p.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/src/http.cpp, line 90
> > <https://reviews.apache.org/r/27446/diff/3/?file=751387#file751387line90>
> >
> >     actually, a utility method on Node to return the string host might be 
> > useful. Or a Try<string> host, actually.

I think we can just add stringify(node) since the Node class overloads the << 
operator.


> On Nov. 6, 2014, 5:44 p.m., Dominic Hamon wrote:
> > 3rdparty/libprocess/src/http.cpp, line 84
> > <https://reviews.apache.org/r/27446/diff/3/?file=751387#file751387line84>
> >
> >     worth adding an accessor to Node to return the in_addr*?

I want to replace the uint32_t type with IPAddress for the ip field and all the 
inet_ntop/inet_pton calls will be handled in the IPAddress struct. For example, 
we can replace this call with stringify method for IPAddress and overload the 
<< operator:

inline
  std::ostream &
operator<< (std::ostream & stream, const IPAddress & ipaddr)
{
  if (ipaddr.family == AF_INET)
    {
      char str[INET_ADDRSTRLEN];
      struct in_addr addr;
      inet_ntop (AF_INET, &addr, str, INET_ADDRSTRLEN);
      stream << str;
    }
  else
    {
      char str[INET6_ADDRSTRLEN];
      struct in6_addr addr;
      inet_ntop (AF_INET6, &addr, str, INET6_ADDRSTRLEN);
      stream << str;
    }
  return stream;
}


- Evelina


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/27446/#review60189
-----------------------------------------------------------


On Nov. 6, 2014, 3:07 a.m., Evelina Dumitrescu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/27446/
> -----------------------------------------------------------
> 
> (Updated Nov. 6, 2014, 3:07 a.m.)
> 
> 
> Review request for mesos, Dominic Hamon, Joris Van Remoortere, and switched 
> to 'mcypark'.
> 
> 
> Bugs: MESOS-2019
>     https://issues.apache.org/jira/browse/MESOS-2019
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> At the moment, the Node class is used to keep a mapping from a socket to the 
> ip & port pair in the process namespace.
> I want to propose to extend its use by replacing the ip & port fields from 
> the UPID class and process namespace with this type.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/include/process/node.hpp 
> 7a96894456683be60595a8f96f85df37947ff5b6 
>   3rdparty/libprocess/include/process/pid.hpp 
> 23453229c2a868a62b143416de33cf630268a64e 
>   3rdparty/libprocess/include/process/process.hpp 
> 81a1f7a3fece78bb7df1e86850572922c8704ea4 
>   3rdparty/libprocess/src/http.cpp 4ef00d11de4ff4e7eb4e44aac204147799f85ac2 
>   3rdparty/libprocess/src/pid.cpp 20ff25c0959c247687955535f02e0397653af52a 
>   3rdparty/libprocess/src/process.cpp 
> 85fb9958342f0bcdde322d9c55333126e6f86668 
>   3rdparty/libprocess/src/tests/benchmarks.cpp 
> 3177a8ecac6adf8b52c3160587dc3a4fe2707d26 
>   3rdparty/libprocess/src/tests/http_tests.cpp 
> a1c3685c88d268c7ecdc2dad22608198dc0b295d 
>   3rdparty/libprocess/src/tests/metrics_tests.cpp 
> 33539e45bab8f79afa773a325465016f01fd3b75 
>   3rdparty/libprocess/src/tests/process_tests.cpp 
> b985fb77ea05fae5c0b144ea48814acc7bb5135b 
> 
> Diff: https://reviews.apache.org/r/27446/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Evelina Dumitrescu
> 
>

Reply via email to