[PATCH] fix messed up txt_log_data_hidden
Whatever I did (active.c ~435 ???) it was unfinished. this should fix things. === modified file 'src/active.c' --- old/src/active.c 2023-08-03 05:45:56 +0000 +++ new/src/active.c 2023-08-17 06:28:19 +0000 @@ -435,18 +435,14 @@ char fmt[25]; snprintf(fmt, sizeof(fmt), "%%"T_ARTNUM_SFMT" %%"T_ARTNUM_SFMT" %%"T_ARTNUM_SFMT" %%%ds", NNTP_GRPLEN); - if (sscanf(line, fmt, &count, &min, &max, ngname) != 4) { -# ifdef DEBUG - if ((debug & DEBUG_NNTP) && verbose > 1) - debug_print_file("NNTP", "Invalid response to \"GROUP %s\txt_log_data_hidden%s\"", ngnames[index_o], line); -# endif /* DEBUG */ - } - if (strcmp(ngname, ngnames[index_o]) != 0) { -# ifdef DEBUG - if ((debug & DEBUG_NNTP) && verbose > 1) - debug_print_file("NNTP", "Groupname mismatch in response to \"GROUP %s\txt_log_data_hidden%s\"", ngnames[index_o], line); -# endif /* DEBUG */ - } +# ifdef DEBUG + if ((debug & DEBUG_NNTP) && verbose > 1) { + if (sscanf(line, fmt, &count, &min, &max, ngname) != 4) + debug_print_file("NNTP", "Invalid response to \"GROUP %s\": \"%s\"", ngnames[index_o], line); + if (strcmp(ngname, ngnames[index_o]) != 0) + debug_print_file("NNTP", "Groupname mismatch in response to \"GROUP %s\": \"%s\"", ngnames[index_o], line); + } +# endif /* DEBUG */ ptr = ngname; free(ngnames[index_o]); index_o = (index_o + 1) % NUM_SIMULTANEOUS_GROUP_COMMAND; @@ -680,7 +676,7 @@ } # ifdef DEBUG if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ TIN_FCLOSE(fp); @@ -763,7 +759,7 @@ # ifdef DEBUG /* log end of multiline response to get timing data */ if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ /* @@ -923,7 +919,7 @@ # ifdef DEBUG /* log end of multiline response to get timing data */ if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ } } === modified file 'src/art.c' --- old/src/art.c 2023-08-03 05:45:56 +0000 +++ new/src/art.c 2023-08-17 06:29:50 +0000 @@ -295,7 +295,7 @@ # ifdef DEBUG /* log end of multiline response to get timing data */ if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ if (tin_errno) @@ -1808,7 +1808,7 @@ # ifdef DEBUG /* log end of multiline response to get timing data */ if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ free(prep_msg); return supported; @@ -2294,7 +2294,7 @@ # ifdef DEBUG /* log end of multiline response to get timing data */ if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ free(group_msg); @@ -2384,7 +2384,7 @@ # ifdef DEBUG /* log end of multiline response to get timing data */ if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ } free(group_msg); === modified file 'src/mail.c' --- old/src/mail.c 2023-05-09 22:05:25 +0000 +++ new/src/mail.c 2023-08-17 06:31:01 +0000 @@ -349,7 +349,7 @@ } # ifdef DEBUG if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ # else @@ -380,7 +380,7 @@ } # ifdef DEBUG if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ } /* TODO: add 483 (RFC 3977) support */ @@ -534,7 +534,7 @@ } # ifdef DEBUG if ((debug & DEBUG_NNTP) && !verbose) - debug_print_file("NNTP", "<<<%s%s", logtime(), ". [full data hidden, rerun with -v]"); + debug_print_file("NNTP", "<<<%s%s", logtime(), txt_log_data_hidden); # endif /* DEBUG */ FreeIfNeeded(groupname); }
On Thu, Aug 17, 2023 at 08:41:44AM +0200, Urs Janßen wrote:
Whatever I did (active.c ~435 ???) it was unfinished. this should fix things.
=== modified file 'src/active.c' --- old/src/active.c 2023-08-03 05:45:56 +0000 +++ new/src/active.c 2023-08-17 06:28:19 +0000 @@ -435,18 +435,14 @@ char fmt[25];
snprintf(fmt, sizeof(fmt), "%%"T_ARTNUM_SFMT" %%"T_ARTNUM_SFMT" %%"T_ARTNUM_SFMT" %%%ds", NNTP_GRPLEN); - if (sscanf(line, fmt, &count, &min, &max, ngname) != 4) { -# ifdef DEBUG - if ((debug & DEBUG_NNTP) && verbose > 1) - debug_print_file("NNTP", "Invalid response to \"GROUP %s\txt_log_data_hidden%s\"", ngnames[index_o], line); -# endif /* DEBUG */ - } - if (strcmp(ngname, ngnames[index_o]) != 0) { -# ifdef DEBUG - if ((debug & DEBUG_NNTP) && verbose > 1) - debug_print_file("NNTP", "Groupname mismatch in response to \"GROUP %s\txt_log_data_hidden%s\"", ngnames[index_o], line); -# endif /* DEBUG */ - } +# ifdef DEBUG + if ((debug & DEBUG_NNTP) && verbose > 1) { + if (sscanf(line, fmt, &count, &min, &max, ngname) != 4) + debug_print_file("NNTP", "Invalid response to \"GROUP %s\": \"%s\"", ngnames[index_o], line); + if (strcmp(ngname, ngnames[index_o]) != 0) + debug_print_file("NNTP", "Groupname mismatch in response to \"GROUP %s\": \"%s\"", ngnames[index_o], line); + } +# endif /* DEBUG */ ptr = ngname; free(ngnames[index_o]); index_o = (index_o + 1) % NUM_SIMULTANEOUS_GROUP_COMMAND;
This change breaks '-n' on some servers (e.g. news.individual.de, which doesn't respond properly to CAPABILITIES and tin doesn't use LIST COUNTS). It works with '-D1 -vv', because then sscanf() is called. The sscanf must be outside of #ifdef DEBUG. Dennis
participants (2)
-
Dennis Preiser -
Urs Janßen