From: Leandro Lucarella Date: Tue, 4 Jul 2006 14:23:54 +0000 (+0000) Subject: Bugfix al mostrar request/response para debug en send_loop(). X-Git-Tag: svn_import~6 X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/commitdiff_plain/5f8ce7344f3e7cba2f4c7a8dbe17471a0387e92d?hp=d40854f63beb6e8ef9b720f88a8175bcb69338ae Bugfix al mostrar request/response para debug en send_loop(). --- 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)); }