git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56922
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxSockAddressPtr SocketTestCase::GetServer() const
{
wxSockAddressPtr SocketTestCase::GetServer() const
{
- wxSockAddressPtr ptr;
- if ( !gs_serverHost.empty() )
- {
- wxIPV4address *addr = new wxIPV4address;
- addr->Hostname(gs_serverHost);
- addr->Service("www");
+ if ( gs_serverHost.empty() )
+ return wxSockAddressPtr();
- ptr = wxSockAddressPtr(addr);
- }
+ wxIPV4address *addr = new wxIPV4address;
+ addr->Hostname(gs_serverHost);
+ addr->Service("www");
+ return wxSockAddressPtr(addr);
}
wxSocketClientPtr SocketTestCase::GetHTTPSocket(int flags) const
{
}
wxSocketClientPtr SocketTestCase::GetHTTPSocket(int flags) const
{
- wxSocketClientPtr ptr;
-
wxSockAddressPtr addr = GetServer();
if ( !addr.get() )
wxSockAddressPtr addr = GetServer();
if ( !addr.get() )
+ return wxSocketClientPtr();
wxSocketClient *sock = new wxSocketClient(flags);
sock->SetTimeout(1);
wxSocketClient *sock = new wxSocketClient(flags);
sock->SetTimeout(1);
sock->Write(httpGetRoot.ToAscii(), httpGetRoot.length());
sock->Write(httpGetRoot.ToAscii(), httpGetRoot.length());
- ptr = wxSocketClientPtr(sock);
- return ptr;
+ return wxSocketClientPtr(sock);
}
void SocketTestCase::BlockingConnect()
}
void SocketTestCase::BlockingConnect()