From 55940154becc8e4fba9336de0917745dcfbed9d8 Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Sat, 3 Aug 2002 10:32:49 +0000 Subject: Transmit CR+LF instead of LF as line terminator. This fixes a problem where it hangs when a news server to connect to is strict with the NNTP standard. PR: ports/41197 Submitted by: Nathan J. Yoder --- news/newsfetch/Makefile | 1 + news/newsfetch/files/patch-nntp.c | 74 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 news/newsfetch/files/patch-nntp.c (limited to 'news') diff --git a/news/newsfetch/Makefile b/news/newsfetch/Makefile index d201bbca1e8a..5c477e59a14a 100644 --- a/news/newsfetch/Makefile +++ b/news/newsfetch/Makefile @@ -7,6 +7,7 @@ PORTNAME= newsfetch PORTVERSION= 1.21 +PORTREVISION= 1 CATEGORIES= news MASTER_SITES= ${MASTER_SITE_SUNSITE} MASTER_SITE_SUBDIR= system/news/readers diff --git a/news/newsfetch/files/patch-nntp.c b/news/newsfetch/files/patch-nntp.c new file mode 100644 index 000000000000..19d5a9a04534 --- /dev/null +++ b/news/newsfetch/files/patch-nntp.c @@ -0,0 +1,74 @@ +--- nntp.c.orig Sat Aug 3 19:24:46 2002 ++++ nntp.c Sat Aug 3 19:26:29 2002 +@@ -33,7 +33,7 @@ + { + /* dummy read to flush input */ + readNNTPdata(); +- fprintf(socket_fp[0],"MODE READER\n"); ++ fprintf(socket_fp[0],"MODE READER\r\n"); + readNNTPdata(); + return(get_error(command_buf)); + } +@@ -151,7 +151,7 @@ + int first_art, last_art, total_art, tmp ; + + fprintf(stderr,"%s: ",group); +- fprintf(socket_fp[0],"GROUP %s\n",group); ++ fprintf(socket_fp[0],"GROUP %s\r\n",group); + readNNTPdata(); + + #ifdef DEBUG +@@ -180,7 +180,7 @@ + first_article = last_art - max_article + 1; + } + +- fprintf(socket_fp[0],"STAT %d\n",first_article); ++ fprintf(socket_fp[0],"STAT %d\r\n",first_article); + readNNTPdata(); + + while(!get_error1(command_buf)) +@@ -196,7 +196,7 @@ + return(0); + } + +- fprintf(socket_fp[0],"STAT %d\n",first_article); ++ fprintf(socket_fp[0],"STAT %d\r\n",first_article); + readNNTPdata(); + } + fprintf(stderr,"articles %d to %d\n",first_article,last_art); +@@ -256,7 +256,7 @@ + fprintf(stderr," %c",0xd); + } + +- fprintf(socket_fp[0],"ARTICLE\n"); ++ fprintf(socket_fp[0],"ARTICLE\r\n"); + readNNTPdata(); + if(!get_error(command_buf)) + return(0); +@@ -275,7 +275,7 @@ + } + + /* Make it little fast */ +- fprintf(socket_fp[0],"NEXT\n"); ++ fprintf(socket_fp[0],"NEXT\r\n"); + + article_fetching=1; + +@@ -329,7 +329,7 @@ + char groupname[100]; + + fprintf(stderr, "\nList of NewsGroups:\n"); +- fprintf(socket_fp[0],"LIST\n"); ++ fprintf(socket_fp[0],"LIST\r\n"); + readNNTPdata(); + if(!get_error2(command_buf)) + exit(1); +@@ -348,7 +348,7 @@ + sendQuit() + { + +- fprintf(socket_fp[0],"QUIT\n"); ++ fprintf(socket_fp[0],"QUIT\r\n"); + readNNTPdata(); + } + -- cgit v1.2.3