Skip to content

Commit

Permalink
Move the WinSock to the Request class
Browse files Browse the repository at this point in the history
  • Loading branch information
elnormous committed Jun 4, 2019
1 parent 6c95c02 commit 0d731e4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions include/HTTPRequest.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@ namespace http
Socket& operator=(const Socket&) = delete;

Socket(Socket&& other):
#ifdef _WIN32
winSock(std::move(other.winSock)),
#endif
endpoint(other.endpoint)
{
#ifdef _WIN32
Expand All @@ -165,7 +162,6 @@ namespace http
if (&other != this)
{
#ifdef _WIN32
winSock = std::move(other.winSock);
if (endpoint != INVALID_SOCKET) closesocket(endpoint);
#else
if (endpoint != -1) close(endpoint);
Expand All @@ -191,7 +187,6 @@ namespace http

private:
#ifdef _WIN32
WinSock winSock;
SOCKET endpoint = INVALID_SOCKET;
#else
int endpoint = -1;
Expand Down Expand Up @@ -613,6 +608,9 @@ namespace http
}

private:
#ifdef _WIN32
WinSock winSock;
#endif
InternetProtocol internetProtocol;
std::string scheme;
std::string domain;
Expand Down

0 comments on commit 0d731e4

Please sign in to comment.