cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: IMAP not working reliably on Win32/VS2012

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Thu, 5 Sep 2013 07:42:10 +0100

Morning,

On Thu 5 Sep 2013, Jirí Hru¹ka wrote:

> I'm fine as well, thank you. Though the summer was too short - again!

Heheh - yes almost over :(

> Uh, not necessarily closed, 0 means "timed out" (even with null
> timeout), so it's like "no data ready right now". But there should
> definitely be more data ready in the socket, as only the contents
> of the downloaded message should have been read!

I have a slightly modified version of pingping.c that after the rc =
Curl_socket_ready() at line 110 now performs a Curl_read().

Even though the return code from Curl_socket_ready() is showing zero,
Curl_read() succeeds with the correct data in the buffer.

Does select() always indicate that there is data waiting to be read even
after previous reads or is it a one-time notification? Ie:

Select indicates there is data to be read - lets say 500 bytes. If we only
read 100 bytes and call select() again does it return a read event to tell
us there is still 400 bytes left or are we expected to read multiple times
before calling select() the second time?

If it is the latter then this could perhaps explain things?

> A wild guess - maybe you encountered this error after
> single-stepping through a lot of code and the connection
> has closed before you got to Curl_socket_ready()? It
> might hide a real problem elsewhere.

I too thought that... I have single stepped through the code but also only
placed one break point after the Curl_socket_read() so the code ran until
after rc = 0. It it also hangs if I run a release version but doesn't if I
take out the FETCH_FINAL process.

> Anyway, what you described is really weird. Otherwise the rest of the
> exchange would surely work fine now...

Interesting I cannot reproduce this with a local connection to Exchange,
either with or without SSL - it only seems to happen with a IMAPS
connection to Google :(

Kind Regards

Steve

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-09-05