diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2011-05-22 22:50:58 +0200 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2011-05-22 23:13:30 +0200 |
commit | 47c05b10018f5ec7493e4bd9f521aaa18d96f1e2 (patch) | |
tree | ed317d21931ab58671af4fedee2af05f3ff7908f /smtp.c | |
parent | f3b0aa05fd1a1912d9c5fad7ebbaa7dcec31e047 (diff) | |
download | fetchmail-47c05b10018f5ec7493e4bd9f521aaa18d96f1e2.tar.gz fetchmail-47c05b10018f5ec7493e4bd9f521aaa18d96f1e2.tar.bz2 fetchmail-47c05b10018f5ec7493e4bd9f521aaa18d96f1e2.zip |
Fix socket timeout handling.
Fixes STARTTLS hangs reported by Thomas Jarosch.
Diffstat (limited to 'smtp.c')
-rw-r--r-- | smtp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -313,10 +313,12 @@ int SMTP_ok(int sock, char smtp_mode, int mintimeout) { SIGHANDLERTYPE alrmsave; char reply[MSGBUFSIZE], *i; + int tmo = (mytimeout >= mintimeout) ? mytimeout : mintimeout; /* set an alarm for smtp ok */ alrmsave = set_signal_handler(SIGALRM, null_signal_handler); - set_timeout(mytimeout >= mintimeout ? mytimeout : mintimeout); + set_timeout(tmo); + SockTimeout(sock, tmo); smtp_response[0] = '\0'; |