Use blocking sockets from non-main threads for passive FTP too
This extends the changes of d421373c2e
to the case of passive FTP, which created wxSocketClient directly and so
didn't use the correct flags when used from a worker thread.
See #17937.
This commit is contained in:
parent
ba8bab2282
commit
40774e1ccd
@ -647,7 +647,11 @@ wxSocketBase *wxFTP::GetPassivePort()
|
||||
addr.Hostname(hostaddr);
|
||||
addr.Service(port);
|
||||
|
||||
wxSocketClient *client = new wxSocketClient();
|
||||
// If we're used from a worker thread or can't dispatch events even though
|
||||
// we're in the main one, we can't use non-blocking sockets.
|
||||
wxSocketClient* const
|
||||
client = new wxSocketClient(wxSocketClient::GetBlockingFlagIfNeeded());
|
||||
|
||||
if ( !client->Connect(addr) )
|
||||
{
|
||||
m_lastError = wxPROTO_CONNERR;
|
||||
|
Loading…
Reference in New Issue
Block a user