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
Return to the default flat view Create a new topic Submit Reply
NNTP and search for uuencoded attachments [message #14222] Mon, 10 November 2003 02:54 Go to previous message
hy2jinxnc is currently offline  hy2jinxnc   United States
Messages: 25
Registered: October 2003
Location: NC
Karma:
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
[Message index]
 
Read Message
Read Message
Read Message
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: Fri Nov 08 21:45:50 GMT 2024

Total time taken to generate the page: 0.10349 seconds