pkgsrc/news/newsfetch/patches/patch-ab
dholland 598c31b169 Increase MAXBUFSIZE as recommended by jrf to fix PR 36882. I've changed
it from 500 to 5000, which should be ample. PKGREVISION to 2.
2010-03-07 07:28:22 +00:00

85 lines
2.1 KiB
Text

$NetBSD: patch-ab,v 1.2 2010/03/07 07:28:22 dholland Exp $
--- nntp.c.orig 2000-11-13 02:01:49.000000000 +0000
+++ nntp.c
@@ -23,7 +23,7 @@ extern FILE *rcfp, *rctmpfp, *socket_fp[
char *header;
-#define MAXBUFSIZE 500
+#define MAXBUFSIZE 5000
char command_buf[MAXBUFSIZE + 1];
/* lots of protos */
@@ -51,7 +51,7 @@ void read_nntp_data()
int set_reader_mode()
{
read_nntp_data();
- fprintf(socket_fp[0], "MODE READER\n");
+ fprintf(socket_fp[0], "MODE READER\r\n");
read_nntp_data();
return (get_error(command_buf));
}
@@ -191,7 +191,7 @@ int check_group()
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);
read_nntp_data();
#ifdef DEBUG
@@ -220,7 +220,7 @@ read_nntp_data();
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);
read_nntp_data();
while (!get_error_noprint(command_buf)) {
@@ -238,7 +238,7 @@ read_nntp_data();
return (0);
}
- fprintf(socket_fp[0], "STAT %d\n", first_article);
+ fprintf(socket_fp[0], "STAT %d\r\n", first_article);
read_nntp_data();
}
@@ -302,7 +302,7 @@ int check_header = 1;
fprintf(stderr, " %c", 0xd);
}
- fprintf(socket_fp[0], "ARTICLE\n");
+ fprintf(socket_fp[0], "ARTICLE\r\n");
read_nntp_data();
if (!get_error(command_buf))
@@ -325,7 +325,7 @@ int check_header = 1;
/*
* Make it little fast
*/
- fprintf(socket_fp[0], "NEXT\n");
+ fprintf(socket_fp[0], "NEXT\r\n");
article_fetching = 1;
#ifndef NO_STATUS_METER
@@ -391,7 +391,7 @@ void get_group_list()
char groupname[100];
fprintf(stderr, "\nList of NewsGroups:\n");
- fprintf(socket_fp[0], "LIST\n");
+ fprintf(socket_fp[0], "LIST\r\n");
read_nntp_data();
if (!get_error_strmsg(command_buf))
@@ -411,7 +411,7 @@ void get_group_list()
void send_quit()
{
- fprintf(socket_fp[0], "QUIT\n");
+ fprintf(socket_fp[0], "QUIT\r\n");
read_nntp_data();
}