X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/c048ca1252065d6705763043eb2ff750d95e52e9..9ee7a97ec97d3dc41e1367f1f457d5ed5d5270ea:/practicas/pipi/src/resolvproto.cpp diff --git a/practicas/pipi/src/resolvproto.cpp b/practicas/pipi/src/resolvproto.cpp index d8c94ed..4c45f69 100644 --- a/practicas/pipi/src/resolvproto.cpp +++ b/practicas/pipi/src/resolvproto.cpp @@ -115,10 +115,11 @@ void ResolvProtoResponse::recv(int sockfd) /// Impresión de response std::ostream& operator<< (std::ostream& os, const ResolvProtoResponse& rpr) { - if (rpr.ips.empty()) - return os; os << "ResolvProtoResponse(ret=" << unsigned(rpr.ret) - << ", ttl=" << rpr.ttl << ", "; + << ", ttl=" << rpr.ttl; + if (rpr.ips.empty()) + return os << ")"; + os << ", "; std::copy(rpr.ips.begin(), rpr.ips.end() - 1, std::ostream_iterator< IPAddr >(os, ", ")); return os << rpr.ips.back() << ")";