cURL cURL > Mailing List > Monthly Index > Single Mail

curl-tracker Archives

[curl:bugs] #1464 FTP transfer fails on Windows Embedded Compact 7 (November 2014 Update)

From: Daniel Stenberg <bagder_at_users.sf.net>
Date: Thu, 18 Dec 2014 23:23:06 +0000

Thanks, but if Win CE has this flaw for non-blocking sockets, shouldn't we do the close() loop within the Curl_closesocket() function so that all socket operations in libcurl get the fix at once?

Also, as you can see in Curl_closesocket(), looping around that function will cause very odd side-effects I don't think any libcurl users expect.

You say this change is necessary since a rather recent change - is it then fully backwards compatible so that introducing this extra logic will still make this work just as well with older Win CE installations?

---
** [bugs:#1464] FTP transfer fails on Windows Embedded Compact 7 (November 2014 Update)**
**Status:** open
**Created:** Fri Dec 12, 2014 10:59 AM UTC by Nikolay Vakhlyarskiy
**Last Updated:** Tue Dec 16, 2014 11:05 AM UTC
**Owner:** Daniel Stenberg
FTP transfer fails on Windows Embedded Compact 7 November 2014 Update, 
when library is built without USE_BLOCKING_SOCKETS.
CURL library version is 7.23.1
The bug is caused due to change in behavior of Windows Sockets, which has been introduced
in November 2014.
When library is compiled without USE_BLOCKING_SOCKET define, the sequence of function calls:
shutdown(...);
closesocket(...);
drops underlying socket data buffers and file transfer is interrupted. FTP server responds
with code 450 on shuch client behavior.
Previously (before Windows Update), the underlying socket data buffers was not dropped by
function call sequence mentoned above.
For non-blocking socket the BUG can be fixed with setting SO_LINGER option with non-zero
timeout, but in this case 'closesocket' function returns -1 and some loop should be
introduced to wait for successful call to 'closesocket'.
Lines in 'ftp.c' file where "the bug lives":
// these lines close access to socket from application
3165: #ifdef _WIN32_WCE
3166:   shutdown(conn->sock[SECONDARYSOCKET],2);  /* SD_BOTH */
3167: #endif
// socket buffers are dropped by this call
3188: Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]);
Thanks, Nikolay Vakhlyarskiy.
---
Sent from sourceforge.net because curl-tracker@cool.haxx.se is subscribed to https://sourceforge.net/p/curl/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/curl/admin/bugs/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.
Received on 2014-12-19

These mail archives are generated by hypermail.