diff options
Diffstat (limited to 'sql/net_serv.cc')
-rw-r--r-- | sql/net_serv.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/sql/net_serv.cc b/sql/net_serv.cc index a0f7a779894..c2da47b480e 100644 --- a/sql/net_serv.cc +++ b/sql/net_serv.cc @@ -284,7 +284,9 @@ my_net_write(NET *net,const char *packet,ulong len) buff[3]= (uchar) net->pkt_nr++; if (net_write_buff(net,(char*) buff,NET_HEADER_SIZE)) return 1; +#ifndef DEBUG_DATA_PACKETS DBUG_DUMP("packet_header",(char*) buff,NET_HEADER_SIZE); +#endif return test(net_write_buff(net,packet,len)); } @@ -394,6 +396,9 @@ net_write_buff(NET *net,const char *packet,ulong len) else left_length= (ulong) (net->buff_end - net->write_pos); +#ifdef DEBUG_DATA_PACKETS + DBUG_DUMP("data", packet, len); +#endif if (len > left_length) { if (net->write_pos != net->buff) @@ -776,6 +781,8 @@ my_real_read(NET *net, ulong *complen) if (i == 0) { /* First parts is packet length */ ulong helping; + DBUG_DUMP("packet_header",(char*) net->buff+net->where_b, + NET_HEADER_SIZE); if (net->buff[net->where_b + 3] != (uchar) net->pkt_nr) { if (net->buff[net->where_b] != (uchar) 255) @@ -784,7 +791,6 @@ my_real_read(NET *net, ulong *complen) ("Packets out of order (Found: %d, expected %u)", (int) net->buff[net->where_b + 3], net->pkt_nr)); - DBUG_DUMP("packet_header",(char*) net->buff+net->where_b, 4); #ifdef EXTRA_DEBUG fprintf(stderr,"Packets out of order (Found: %d, expected %d)\n", (int) net->buff[net->where_b + 3], @@ -841,6 +847,10 @@ end: vio_blocking(net->vio, net_blocking, &old_mode); } net->reading_or_writing=0; +#ifdef DEBUG_DATA_PACKETS + if (len != packet_error) + DBUG_DUMP("data",(char*) net->buff+net->where_b, len); +#endif return(len); } |