Hey all, I'm working on some legacy code that uses FRESH_CONNECT as a hack to ensure that sockets left in inconsistent state are closed and refreshed.
Possible causes of inconsistent state are http-level timeout/confusion, server bugs, read/write function bugs, incomplete chunked transfer read-out via error return from readdata function, incorrect content-length, etc. First off, was the original developer's logic sounds in single-threaded case? I'm trying to make this code logically thread-safe. New libcurl handle is allocated for each transfer, but the underlying socket is up to libcurl to reuse or recreate. This begs the question, is libcurl's socket cache per-thread or global? If it's global, are sockets reused between threads? If so, I suppose FRESH_CONNECT only hides the problem. in this case, what's the right way to explicitly close the underlying socket? thanks, d. ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html
