From 30927ad7741ac0959e0b19ec994ed1521cb86b71 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Sat, 16 Feb 2008 09:20:18 +0000
Subject: [PATCH] Supports command lines and responses up to 4 Kbytes per line
 (8 times the max specified in RFCs).

---
 exec/newslink.js | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/exec/newslink.js b/exec/newslink.js
index 0790ee25c7..2be1d6487d 100644
--- a/exec/newslink.js
+++ b/exec/newslink.js
@@ -106,11 +106,12 @@ function writeln(str)
 	write(str + "\r\n");
 }
 
-function readln(len)
+// RFC977 and RFC3977 clearly state 512-bytes per response line,
+// but "Timelord" reported a problem with some news server sending
+// > 512-byte response lines for the XOVER command
+function readln()
 {
-	if(!len)
-		len=512;	// RFC977 and RFC3977 specify a maximum of 512-octets per response line
-	rsp = socket.recvline(len);
+	rsp = socket.recvline(4096);
 	if(debug)
 		printf("rsp: %s\r\n",rsp);
 	return(rsp);
@@ -545,10 +546,7 @@ for(i in area) {
 		if(parseInt(readln())==224) {
 			printf("Getting headers for articles %u through %u\r\n", ptr, last_msg);
 			article_list = new Array();
-			// RFC977 and RFC3977 clearly state 512-bytes per response line,
-			// but "Timelord" reported a problem with some news server sending
-			// > 512-byte response lines for the XOVER command
-			while((rsp=readln(1024))!='.' && socket.is_connected && !js.terminated) {
+			while((rsp=readln())!='.' && socket.is_connected && !js.terminated) {
 				if(rsp)
 					article_list.push(parseInt(rsp));
 				maybe_yield();
-- 
GitLab