}
if (wmnotify_infos.debug) {
- printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
- printf("IMAP4 Server Response (size %d bytes):\n", len);
printf("%s", rx_buffer);
- printf("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\n");
}
/*
{
int len;
int i;
+ char debug_buffer[sizeof(tx_buffer)];
+ int debug_len;
/* Adding Transaction Label. */
tlabel++;
len += sprintf(tx_buffer + len, "%d", tlabel);
tlabel_len = len;
+ debug_len = 0;
+ debug_len += sprintf(debug_buffer + debug_len, "%s", tx_buffer);
+
/* Adding command and it's arguments. */
- for (i = 0; i < argc; i++)
+ for (i = 0; i < argc; i++) {
len += sprintf(tx_buffer + len, " %s", argv[i]);
+ if (STREQ(argv[0], IMAP4_CMD_LOGIN) && (i == 2)) {
+ debug_len += sprintf(debug_buffer + debug_len,
+ " XXXXXXXX");
+ }
+ else {
+ debug_len += sprintf(debug_buffer + debug_len,
+ " %s", argv[i]);
+ }
+ }
+
if (wmnotify_infos.debug) {
- tx_buffer[len] = '\0';
- printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
- printf("IMAP4 Client Command (size %d bytes):\n%s\n", len,
- tx_buffer);
- printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n");
+ debug_buffer[debug_len] = '\0';
+ printf("%s\n", debug_buffer);
}
/* Adding termination characters. */