On Wednesday 26 August 2009 18:58:52 Michael Yip wrote:
> Matthew Toseland wrote:
> > On Wednesday 26 August 2009 01:38:29 Daniel Cheng wrote:
> >   
> >> On Tue, Aug 25, 2009 at 11:44 PM, Ian Clarke<i...@locut.us> wrote:
> >>     
> >>> On Tue, Aug 25, 2009 at 8:51 AM, Matthew
> >>> Toseland<t...@amphibian.dyndns.org> wrote:
> >>>       
> >>>>> It's not a joke but I admit I misunderstood the specification. I was
> >>>>> wondering how to detect the end of a AllData reply and I thought there
> >>>>> would be something such as "EndMessage".
> >>>>>           
> >>>> No, it ends with the word "Data" on a line by itself and is followed by 
> >>>> the data.
> >>>>         
> >>> To clarify, the plaintext part of the message ends with "Data" on a
> >>> line by itself.
> >>>
> >>> It is followed by the raw data.  It is not necessary to specify when
> >>> the raw data ends since its length is provided in the plaintext part
> >>> of the message.
> >>>       
> >> The current implementation would be confused if you do this:
> >>
> >> ClientPut<CR>
> >> blbarlbalr=...<CR>
> >> blbarlbalr=...<CR>
> >> DataLength=1<CR>
> >> Data<CR>
> >> <LF>
> >>
> >> This should insert a single byte file with <LF>, but it would get confused.
> >>     
> >
> > So the problem is we don't assume the client consistently uses the same 
> > linefeed marker? File a bug.
> >   
> 
> Err... this problem started after I've misread the spec. Easy solution 
> is to parse the DataLength value and just read the number of bytes as 
> the DataLength value?

Yes, if there are trailing bytes there is always a DataLength value. Some 
messages sent from the client to the node have multiple DataLength's (with 
different prefixes), but any message sent to the node will have only one, 
without a prefix. We always send a newline after "Data", and the data will 
start after that.

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Devl mailing list
Devl@freenetproject.org
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl

Reply via email to