mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-08 02:47:43 +02:00
- Fix streamtcp to print packet data to stdout. This makes the
stdout and stderr not mix together lines, when parsing its output.
This commit is contained in:
@@ -200,6 +200,7 @@ write_q(int fd, int udp, SSL* ssl, sldns_buffer* buf, uint16_t id,
|
||||
static void
|
||||
recv_one(int fd, int udp, SSL* ssl, sldns_buffer* buf)
|
||||
{
|
||||
size_t i;
|
||||
char* pktstr;
|
||||
uint16_t len;
|
||||
if(!udp) {
|
||||
@@ -270,7 +271,13 @@ recv_one(int fd, int udp, SSL* ssl, sldns_buffer* buf)
|
||||
len = (size_t)l;
|
||||
}
|
||||
printf("\nnext received packet\n");
|
||||
log_buf(0, "data", buf);
|
||||
printf("data[%d] ", (int)sldns_buffer_limit(buf));
|
||||
for(i=0; i<sldns_buffer_limit(buf); i++) {
|
||||
const char* hex = "0123456789ABCDEF";
|
||||
printf("%c%c", hex[(sldns_buffer_read_u8_at(buf, i)&0xf0)>>4],
|
||||
hex[sldns_buffer_read_u8_at(buf, i)&0x0f]);
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
pktstr = sldns_wire2str_pkt(sldns_buffer_begin(buf), len);
|
||||
printf("%s", pktstr);
|
||||
|
||||
Reference in New Issue
Block a user