FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » NNTP and search for uuencoded attachments
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
NNTP and search for uuencoded attachments [message #14222] Mon, 10 November 2003 02:54 Go to next message
hy2jinxnc is currently offline  hy2jinxnc   United States
Messages: 25
Registered: October 2003
Location: NC
Karma: 0
Junior Member

I was running into a problem where if a nntp post had the word "begin" starting a line the nntp.php import script would hang if there was no uuencoded attachment to be decoded. Here is the "fix" which uses preg_match("/begin\s[0-7]{3}/", $this->body).

Also, because of this bug cropping up, I encountered a situation that caused messages to be imported multiple times. In function parse_msgs the message "counter" is not written to until all messages are parsed. If one should cause a problem and the script to break, such as the problem above, then the message "counter" file is not written to. Therefore on the next run of nntp.php it tries to import the same messages again (and again hits the one it hangs on. So I added one line that will write the current message id to the message control file. This way if it breaks you don't get tons of duplicates before it is noticed and you can quickly identify the message causing the problem. Yes it's a ton of disk writes if you are importing a lot of messages, but that is nothing compared to cleaning up that many duplicates or dumping everything and reimporting IMO.

Patch is based on v2.6.0RC2
Re: NNTP and search for uuencoded attachments [message #14230 is a reply to message #14222] Mon, 10 November 2003 14:05 Go to previous messageGo to next message
Ilia is currently offline  Ilia   Canada
Messages: 13241
Registered: January 2002
Karma: 0
Senior Member
Administrator
Core Developer
The possible loop in attachment decoding is fixed in CVS.

FUDforum Core Developer
Re: NNTP and search for uuencoded attachments [message #14242 is a reply to message #14230] Tue, 11 November 2003 03:54 Go to previous message
hy2jinxnc is currently offline  hy2jinxnc   United States
Messages: 25
Registered: October 2003
Location: NC
Karma: 0
Junior Member

Thanks. Never occured to me to look for something like that. Still have lots to learn about php.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Hack to hide DB Password in Admin Globals
Next Topic: Use .htaccess for authentication
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Apr 18 06:18:16 GMT 2024

Total time taken to generate the page: 1.53830 seconds