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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user