Thread View: news.software.nntp
4 messages
4 total messages
Started by student
Fri, 14 Jun 1996 00:00
What's the problem?
Author: student
Date: Fri, 14 Jun 1996 00:00
Date: Fri, 14 Jun 1996 00:00
30 lines
1428 bytes
1428 bytes
Hello,
I have a homework to study the Network News Transfer
Protocol, and, I wrote a client program to contact with the
news server. But ....
I read the RFC977, and the document expressed that
the text response will be ended by CR-LF.CR-LF. But, my
^^^^^^^^^^^
program is always in the block state when it read the CR-LF.
and wait for another CR-LF.
I don't know if the server sent the whole CR-LF.CR-LF, so
I tried to write a different program which will think that the
server will send CR-LF. to represent the end of the text response.
^^^^^^
And, it worked smoothly in the beginning, but it still have
some errors in the reading operation.
Could anybody tell me what the problem is ?
Thanks for your help.
C.C.Yang
Re: What's the problem?
Author: Jacques Jamain
Date: Sat, 15 Jun 1996 00:00
Date: Sat, 15 Jun 1996 00:00
27 lines
1444 bytes
1444 bytes
In article <4praqc$1om@netnews.ntu.edu.tw>, s1611372@mcu.edu.tw (student) wrote: [...] > > I read the RFC977, and the document expressed that >the text response will be ended by CR-LF.CR-LF. But, my >program is always in the block state when it read the CR-LF. >and wait for another CR-LF. > I don't know if the server sent the whole CR-LF.CR-LF, so >I tried to write a different program which will think that the >server will send CR-LF. to represent the end of the text response. >And, it worked smoothly in the beginning, but it still have >some errors in the reading operation. > Could anybody tell me what the problem is ? > My experience is that the end of stream from the news server is always: "crlf.\0" (w/o "), no ending crlf. Hope this help. Cheers d:) -- Jacques JAMAIN - jamain@ibm.net ... on the french riviera ...
Re: What's the problem?
Author: David Woolley
Date: Sat, 22 Jun 1996 00:00
Date: Sat, 22 Jun 1996 00:00
41 lines
1923 bytes
1923 bytes
In article <DqtwxA3ibtQc090yn@ibm.net>, Jacques Jamain <jamain@ibm.net> wrote:
>
>My experience is that the end of stream from the news server
>is always: "crlf.\0" (w/o "), no ending crlf.
That's broken. What news server are you using. I've accessed nntp-1.5.*,
INN and Demon's NewsBorg and they all give CR LF . CF LF, such that the
following script will correctly parse the articles.
#! /usr/bin/perl
$batchsize = 300000;
$batchseq = "aaa";
$articleend=0;
open (batchfile, ">batch${batchseq}.txt");
while (<STDIN> ) {
if (/^220 /) {
if ($articleend > $batchsize) {
close batchfile;
$batchseq ++;
open (batchfile, ">batch${batchseq}.txt");
$articleend = 0;
}
$currentarticle = "";
while ( <STDIN>) {
s/\r$//;
last if (/^\.$/);
s/^\.//;
$currentarticle .= $_;
}
$articlesize = length $currentarticle;
print batchfile "#! rnews ". $articlesize ."\n";
print batchfile $currentarticle;
$articleend += $articlesize;
}
}
--
David Woolley, London, England david@djwhome.demon.co.uk
Re: What's the problem?
Author: Jacques Jamain
Date: Mon, 01 Jul 1996 00:00
Date: Mon, 01 Jul 1996 00:00
25 lines
1442 bytes
1442 bytes
In article <DtEp9M.EFq@djwhome.demon.co.uk>, David Woolley <david@djwhome.demon.co.uk> wrote: >In article <DqtwxA3ibtQc090yn@ibm.net>, Jacques Jamain <jamain@ibm.net> wrote: >> >>My experience is that the end of stream from the news server >>is always: "crlf.\0" (w/o "), no ending crlf. > >That's broken. What news server are you using. I've accessed nntp-1.5.*, >INN and Demon's NewsBorg and they all give CR LF . CF LF, such that the >following script will correctly parse the articles. [...] ... what your script get is not always what is in. When my socket program reads \0 it adds whatever is convenient for the plateform it is running on: nl, crlf... It's just what i saw (i think i saw), but who knows! Cheers. -- Jacques JAMAIN - jamain@ibm.net ... on the french riviera ...(hot & sunny)...
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads