Use blocking server socket in non-main threads for active FTP

This is similar to the previous commit, but for active FTP connections.
wxSocketServer was also created directly in this case, without using
wxProtocol ctor, so wxSOCKET_BLOCK must be explicitly specified when
creating it from worker thread, just as it was already done in
d421373c2e for the other connections and
in the previous commit for passive FTP ones.

See #17937.
This commit is contained in:
Vadim Zeitlin 2017-08-15 19:30:42 +02:00
parent 40774e1ccd
commit 8d66bfd7ef

View File

@ -582,7 +582,13 @@ wxSocketBase *wxFTP::GetActivePort()
addrNew.AnyAddress();
addrNew.Service(0); // pick an open port number.
wxSocketServer *sockSrv = new wxSocketServer(addrNew);
wxSocketServer* const
sockSrv = new wxSocketServer
(
addrNew,
wxSocketServer::GetBlockingFlagIfNeeded()
);
if (!sockSrv->IsOk())
{
// We use IsOk() here to see if everything is ok