X-Git-Url: https://git.llucax.com/z.facultad/75.74/practicos.git/blobdiff_plain/d40854f63beb6e8ef9b720f88a8175bcb69338ae..5f8ce7344f3e7cba2f4c7a8dbe17471a0387e92d:/practicas/pipi/src/nameserver.cpp?ds=inline 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)); }