Commit 288c67b4287b82f43e10fd35f7994f95e97c0366
1 parent
ccfdd9fe
Exists in
master
and in
3 other branches
Ajustando teste de rede
Showing
1 changed file
with
6 additions
and
5 deletions
Show diff stats
telnet.c
| @@ -2710,12 +2710,13 @@ opt(unsigned char c) | @@ -2710,12 +2710,13 @@ opt(unsigned char c) | ||
| 2710 | 2710 | ||
| 2711 | void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, int len) | 2711 | void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, int len) |
| 2712 | { | 2712 | { |
| 2713 | + #define NETDUMP_MAX 121 | ||
| 2713 | 2714 | ||
| 2714 | if (lib3270_get_toggle(hSession,LIB3270_TOGGLE_NETWORK_TRACE)) | 2715 | if (lib3270_get_toggle(hSession,LIB3270_TOGGLE_NETWORK_TRACE)) |
| 2715 | { | 2716 | { |
| 2716 | - char l1[82]; | ||
| 2717 | - char l2[82]; | ||
| 2718 | - char l3[82]; | 2717 | + char l1[NETDUMP_MAX+2]; |
| 2718 | + char l2[NETDUMP_MAX+2]; | ||
| 2719 | + char l3[NETDUMP_MAX+2]; | ||
| 2719 | 2720 | ||
| 2720 | int offset; | 2721 | int offset; |
| 2721 | int col = 0; | 2722 | int col = 0; |
| @@ -2724,7 +2725,7 @@ void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, in | @@ -2724,7 +2725,7 @@ void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, in | ||
| 2724 | 2725 | ||
| 2725 | time(<ime); | 2726 | time(<ime); |
| 2726 | strftime(l1, 81, "%x %X", localtime(<ime)); | 2727 | strftime(l1, 81, "%x %X", localtime(<ime)); |
| 2727 | - lib3270_write_nettrace(hSession,"%c %s %s data len=%d\n\n",direction,l1,direction == '>' ? "outbound" : "inbound", len); | 2728 | + lib3270_write_nettrace(hSession,"%c %s %s data len=%d\n\n",direction,l1,direction == '>' ? "SEND" : "RECV", len); |
| 2728 | 2729 | ||
| 2729 | for (offset = 0; offset < len; offset++) | 2730 | for (offset = 0; offset < len; offset++) |
| 2730 | { | 2731 | { |
| @@ -2737,7 +2738,7 @@ void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, in | @@ -2737,7 +2738,7 @@ void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, in | ||
| 2737 | l2[col] = text[0]; | 2738 | l2[col] = text[0]; |
| 2738 | l3[col] = text[1]; | 2739 | l3[col] = text[1]; |
| 2739 | 2740 | ||
| 2740 | - if(++col >= 80) | 2741 | + if(++col >= NETDUMP_MAX) |
| 2741 | { | 2742 | { |
| 2742 | l1[col] = l2[col] = l3[col] = 0; | 2743 | l1[col] = l2[col] = l3[col] = 0; |
| 2743 | lib3270_write_nettrace(hSession,"\t%s\n\t%s\n\t%s\n\n",l1,l2,l3); | 2744 | lib3270_write_nettrace(hSession,"\t%s\n\t%s\n\t%s\n\n",l1,l2,l3); |