Blog
Scribe Dropped Mail Bug
Date: 7/4/2004
I think I may have found the cause of Scribe dropping mail, ie. downloading it but not inserting it into the mail folders.

In test9 I tried to prevent Scribe from deleting the mail from the server if the download failed. Which should mean that at least the mail is doesn't disappear. However that doesn't solve the bug it just stops the data from being lost.

Now I've discovered what I believe to be the root cause in the POP receive code where if the initial recv on the connection contains the entire message (ie. small message + fast connection) then the code goes down a slightly different path and doesn't set the status code for that message correctly. Which I've just fixed in the developement build.

It remains to be seen whether this is the only cause of the problem or there are other things causing the same problem.

In a semi-related note I'm moving the socket implementation in Lgi to non-blocking (at least on Linux) to work around other API problems. When you close a socket in Linux that is blocking in another thread the blocking function doesn't return. Whereas under Windows it does, with an error code. Which is really handy, you can fire off a thread to handle the connection and if for any reason you want to cancel out of that thread from your main GUI thread you just close the socket and everything will just error out. However all that doesn't work on Linux as I've found out. That in itself required moving to a non-blocking architecture. However I've noticed on Windows that occasionally the socket stalls in an infinite loop inside a 'connect' or 'recv' and never times out. Which is bad behaviour anyway. So a proper non-blocking implementation can easily do timeouts as well. There might be a way to set a timeout for a Windows socket using some Win32 API call which I could investigate when I care enough to do something about it.

So in the next few days I'll do some more testing and release this bug fix for the world to play with. Then I've really only got the "100% CPU" bug to track down so that I can get back to general development.
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]