[tin-dev] -C and timeout with low nntp_read_timeout_secs and huge group

Urs Janßen urs at tin.org
Wed Jul 19 07:16:26 CEST 2023


In <mailman.1672.1689718883.1791.tin-dev at tin.org> on Wed, 19 Jul 2023 00:21:21,
    Urs Janßen wrote:
> does something like this make any sense?

this documents the problem with -C (in batch mode) and keeps the current
behavior for uncompressed connections and compressed batch mode. comments?

=== modified file 'doc/tin.1'
--- doc/tin.1	2023-07-11 07:56:38 +0000
+++ doc/tin.1	2023-07-19 04:58:50 +0000
@@ -117,7 +117,7 @@
 .TP
 .B \-C
 Use COMPRESS NNTP extension (\fBRFC\%8054\fP) if available. See also
-the "SECURITY" and "BUGS" section.
+\fBnntp_read_timeout_secs\fP and the "SECURITY" and "BUGS" section.
 .TP
 .B \-d
 Don't load newsgroup descriptions and servers message of the day
@@ -2163,7 +2163,12 @@
 .TP
 .B NNTP read timeout in seconds (nntp_read_timeout_secs)
 Time in seconds to wait for a response from the server. Default is 120.
-Setting this to 0 means no timeout.
+Setting this to 0 means no timeout. As if you use the "\fB\-C\fP" option
+in conjunction with a low value for \fBnntp_read_timeout_secs\fP may
+result in a timeout (and disconnect in batch mode) when connecting to large
+servers or entering large groups, because the timer is set when the command
+is sent to the server and that needs some time to compress the large
+response, the value should not be set too small.
 .TP
 .B Unicode normalization form (normalization_form)
 The normalization form \fBtin\fP should use to normalize unicode input.

=== modified file 'src/signal.c'
--- src/signal.c	2023-06-27 01:46:29 +0000
+++ src/signal.c	2023-07-19 05:08:07 +0000
@@ -432,7 +432,23 @@
 			if ((debug & DEBUG_NNTP) && verbose > 1)
 				debug_print_file("NNTP", "get_server() %d sec elapsed without response", tinrc.nntp_read_timeout_secs);
 #	endif /* DEBUG */
-			tin_done(NNTP_ERROR_EXIT, _("NNTP connection error. Exiting..."));
+
+#	ifdef USE_ZLIB
+			/*
+			 * response compression from the server may take while
+			 * when running interactively and not beeimg in the 
+			 * connection phase give the user a change to go on
+			 * instead of exiting
+			 * TODO: strings to lang.c and incl. nntp_read_timeout_secs
+			 */
+			if (signal_context == cReconnect || batch_mode || !use_compress || !nntp_caps.compress || prompt_yn(_("Read timeout from server - quit tin?"), FALSE) == 1)
+#	endif /* USE_ZLIB */
+				tin_done(NNTP_ERROR_EXIT, _("NNTP connection error. Exiting..."));
+#	ifdef USE_ZLIB
+			else {
+				RESTORE_HANDLER(sig, signal_handler);
+			}
+#	endif /* USE_ZLIB */
 			return;
 #endif /* HAVE_ALARM && SIGALRM */
 


-- 
Jef Poskanzer:
"When people aren't stupid Usenet is even more useful. Too bad this happens
 so rarely."



More information about the tin-dev mailing list