To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.admin.generalOpen lugnet.admin.general in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Administrative / General / 1306
1305  |  1307
Subject: 
Re: posting failure?
Newsgroups: 
lugnet.admin.general
Date: 
Mon, 12 Apr 1999 07:32:39 GMT
Viewed: 
796 times
  
In lugnet.admin.general, Todd Lehman writes:
[...]
Instead of using post(@lines), a successful workaround is to use post() and
send the article line-by-line with repeated datasend($line) calls.
(Luckily, calling datasend() directly is a perfectly acceptable use of
Net::NNTP, according to its docs, so it's not really a kludge -- although
it's probably 1/100 second slower on a large article.)
[...]

Well, what I wrote above in February was not entirely correct.  It is
necessary (at least on this system) to FLUSH the socket's buffer when it
becomes full.  I am not very knowledgeable about sockets in Perl, and it's
not a well-documented area, but one thing is clear:  it certainly makes
sense in light of what the Camel book said about syswrite().

So -- fixing the bug...

Since the buffer is being written into from code in a standard library,
I changed my posting loop from one which simply calls $nntp->datasend()
for each line of the article to one which calls $nntp->datasend() followed
by $nntp->flush() for each line.  This is not ideal, since it will fail if
any line ever exceeds the buffer size (~16KB), which is extremely unlikely,
but the code may break someday on another system.

But we appear to be OK now in the case of uploading large DAT files through
the web interface and sending large bodies of content via the mail-to-news
gateways.

I have to do more stress-testing before I can say I'm fully confident with
this fix, but I've got a good feeling about it so far.  I was able to
whittle the problem down to a very simple test case which I could make fail
consistently (loss of data) from the web-upload & e-mail and succeed
consistently (no loss of data) from a standard NNTP newsreader.  This
eliminated the NNTP server as part of the equation, as well as mail
transport agents, user error, etc.

The problem had nothing whatsoever to do with line endings, but it is nice
that it still wasn't too bizarre.

--Todd



Message has 1 Reply:
  Re: posting failure?
 
(...) Hold that thought! (...) Well, I feel pretty stoopit now for making the above post -before- doing more stress testing. :-/ A 595KB file I just posted (to a faux group) dropped a few lines in the middle. This bug is out of my league. I'm not (...) (25 years ago, 12-Apr-99, to lugnet.admin.general)

Message is in Reply To:
  Re: posting failure?
 
(...) Getting closer...I have a workaround. I'll have to talk to the authors of the Net::Cmd module to be absolutely certain about the nature of the problem, but I think I see it clearly now. The post() method of Net::NNTP goes like this[1]: sub (...) (25 years ago, 8-Feb-99, to lugnet.admin.general)

12 Messages in This Thread:


Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR