From 5f8ce7344f3e7cba2f4c7a8dbe17471a0387e92d Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Tue, 4 Jul 2006 14:23:54 +0000 Subject: [PATCH] Bugfix al mostrar request/response para debug en send_loop(). --- practicas/pipi/src/nameserver.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/practicas/pipi/src/nameserver.cpp b/practicas/pipi/src/nameserver.cpp index 82ca2af..b7346b7 100644 --- a/practicas/pipi/src/nameserver.cpp +++ b/practicas/pipi/src/nameserver.cpp @@ -430,8 +430,13 @@ void NameServer::send_loop() Dev::mac_type mac = 0; std::string buf = snd_que.receive(mac); #ifdef DEBUG_RESOLV - std::cout << "NameServer::send_loop() -> envío request " - << ResolvProtoResponse(buf) << "\n"; + uint8_t type; + memcpy(&type, s.data(), sizeof(uint8_t)); + std::cout << "NameServer::send_loop() -> envío " + if (type == RP_REQ_DIRECT || type == RP_REQ_RECURSIVE) + std::cout << "request " << ResolvProtoRequest(buf) << "\n"; + else + std::cout << "response " << ResolvProtoResponse(buf) << "\n"; #endif ipout.send(buf, RESOLV_PROTO, IPAddr(mac)); } -- 2.43.0