๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
10 messages
10 total messages Started by Jean Fermant Tue, 06 Apr 2004 15:23
yEnc multipart binaries
#68924
Author: Jean Fermant
Date: Tue, 06 Apr 2004 15:23
22 lines
1800 bytes
Hi,

I'm currently making a newsreader in PHP, and I have some
problemns finding out all the parts of a post. I could rely
on the subject line (ie '(12/97)' for example) but I don't
find it very satisfying. I've seen that a yEnc file contains
the number of the part on the '=ypart' line, but it is in the
body of the message.

I would like to know the part number of the part, but without
reading all the body, because it can be very big... The line which
tells the part number is fortunately at the beginning of the body,
often at the 2nd or 3rd line, but I've found no way of just reading
the 3 first lines of the body.

I'm using TCP sockets, and I can't send another command without reading
all the body.

Is there a way of just reading only the 3 first lines of the body ?


Thanks in advance.
Re: yEnc multipart binaries
#68930
Author: Clive D. W. Feather
Date: Wed, 07 Apr 2004 10:16
11 lines
1703 bytes
In article <9317993c.0404060723.2ed1c29e@posting.google.com>, Jean 
Fermant <jean.fermant@dodgeit.com> writes
>Is there a way of just reading only the 3 first lines of the body ?

In NNTP? No, though an extension could be designed to allow this.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8495 6138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
Re: yEnc multipart binaries
#68935
Author: Jean Fermant
Date: Wed, 07 Apr 2004 19:32
12 lines
1515 bytes
> >Is there a way of just reading only the 3 first lines of the body ?
> 
> In NNTP? No, though an extension could be designed to allow this.


That means that if I want to read the part number of a yEnc file on the
second or third line of the body of a 15MB file, I must read all the file ?

How do the news readers know how to assemble the parts of a post ?
Do they rely only on the subject ?

Thanks for your answer.
Re: yEnc multipart binaries
#68940
Author: Bas Ruiter
Date: Wed, 07 Apr 2004 21:46
22 lines
1898 bytes
> I'm currently making a newsreader in PHP, and I have some
> problemns finding out all the parts of a post. I could rely
> on the subject line (ie '(12/97)' for example) but I don't
> find it very satisfying.

The subject line IS the way to do it.

But don't rely on it.. it's an educated guess only.

You can improve the accuracy of grouping parts of a post
by looking at the time and the poster as well, for example.

> Is there a way of just reading only the 3 first lines of the body ?

Kind of... start reading the body, when you got what you want, kill
the connection. But that's not a very... friendly way of doing it.


Alternatively, you could wait till xBin becomes mainstream.. then
the info you want will be in the msgID. (This was a joke.. kind of :)
Re: yEnc multipart binaries
#68941
Author: Bas Ruiter
Date: Wed, 07 Apr 2004 21:47
9 lines
1366 bytes
> How do the news readers know how to assemble the parts of a post ?

They don't "know" (as if, for certain). It's all an educated guess.

> Do they rely only on the subject ?

Mainly, yes.
Re: yEnc multipart binaries
#68942
Author: Dr.Ruud
Date: Wed, 07 Apr 2004 21:52
18 lines
1661 bytes
Toen ik Bas Ruiter kietelde, kwam er dit uit:

>> I'm currently making a newsreader in PHP, and I have some
>> problemns finding out all the parts of a post. I could rely
>> on the subject line (ie '(12/97)' for example) but I don't
>> find it very satisfying.

> The subject line IS the way to do it.

How about the References-header?

-- 
Affijn, Ruud   `  -  ยด
               + ` ยด *
                 ยด `
               ยด  =  `

Re: yEnc multipart binaries
#68943
Author: Bas Ruiter
Date: Thu, 08 Apr 2004 00:01
10 lines
1440 bytes
> > The subject line IS the way to do it.

> How about the References-header?

Are you telling me that multi-part posts use the References header... or
are you suggesting its use?

If the first: I didn't know that. If the second: good idea.
Re: yEnc multipart binaries
#68945
Author: Klaas
Date: Thu, 08 Apr 2004 00:43
19 lines
1944 bytes
After careful consideration, Bas Ruiter muttered:

> 
>> > The subject line IS the way to do it.
> 
>> How about the References-header?
> 
> Are you telling me that multi-part posts use the References header... or
> are you suggesting its use?
> 
> If the first: I didn't know that. If the second: good idea.

We have beaten the idea around in the past.  

http://groups.google.com/groups?
q=references+binary+group:news.software.nntp&hl=en&lr=&ie=UTF-8&oe=UTF-8
&selm=04578.563201%40archiver.winews.net&rnum=2

-Mike
Re: yEnc multipart binaries
#68944
Author: Jean Fermant
Date: Thu, 08 Apr 2004 10:36
18 lines
1846 bytes
> > Is there a way of just reading only the 3 first lines of the body ?
> 
> Kind of... start reading the body, when you got what you want, kill
> the connection. But that's not a very... friendly way of doing it.

I've already thought of doing that, but there is a big drawback :
for each part of a post, you must kill the connection, and then
open another one, so you lose the handle...

And that's a big problem because the library I've done relies on the
handle of the current connection, so if it's always changing, it's gonna
be hard...

Anyway, I don't think it's a good idea, but I was asking if there was
another one... and apparently there isn't.

So thanks for your answers ! Will try to find another way using only the
headers.
Re: yEnc multipart binaries
#68948
Author: Tommy van Leeuwen
Date: Thu, 08 Apr 2004 18:19
24 lines
2110 bytes
On Wed, 07 Apr 2004 12:32:51 -0700, Jean Fermant wrote:

> How do the news readers know how to assemble the parts of a post ?
> Do they rely only on the subject ?
> 
> Thanks for your answer.

I use my own perl clients for a while now. It seems to go right in most
cases using a subject match like: 

	m/^(.*\D)(\d+)\s*o\s*f\s*(\d+)(.*)/i
        m/^(.*\D)(\d+)\s*\/\s*(\d+)(.*)/

(Having the current part in $3 and the total parts in $4)

In fact, there was not a single download i couldn't retrieve using above
expressions. Although the expression by itself sucks.

Actually, I've announced a small XPAT client in news.software.readers a
few minutes ago. It's at http://home.support.nl/~tommy/getxpat/ :)

Cheers,
Tommy
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