[PATCH]: POP3 hangs solved (I hope)

	Hi all,
finally here is the patch corresponding to my observations, it's simple and
(AFAI have tested it) it fixes hangs when doing pop retrieving.
The cause of the hang was because we always closed a file descriptor that
got to be set by the pop3 connection, even in cases where the connection
had not been established. So on connection errors (host not found or
anything that will prevent the file descriptor to be properly set) we
blindly used write and close on a bad descriptor.
If it doesn't fix all hangs on pop3 retrieving, at least it is more robust

All changes are in libbalsa/pop3.c :
- one error message typo
- I have moved a test on a pointer before using strchr on it (strchr on
NULL leads to a segfault)
- I have made the test to see if we send the "quit" command to the pop
server to be more selective (doesn't send the command when the connection
have not been set due to connection errors)
- I have added a test to prevent us to close the file descriptor of the pop
connection if it has not been set due to connection errors).

Patch attached.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]