X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/c048ca1252065d6705763043eb2ff750d95e52e9..63516fdd4cb64b01971750be1d29d7244b1f9e5e:/practicas/pipi/src/resolvproto.cpp?ds=sidebyside 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() << ")";