Fix a bad std::move in HttpConnection

C++ Standard says that the order of evaluation of arguments is
unspecified. Even if it wasn't, std::move would run first, invalidating
the httpRequest smartptr, so that httpRequest->createRequest() would be
executed on the invalid ptr.
Some compilers might be smart enough to correct this error, clang XCode
Edition surely is not (not should it).
pull/106/head
Nils Maier 2013-07-07 06:01:34 +02:00
parent 3f5f1e26d9
commit fc6318d23f
1 changed files with 2 additions and 1 deletions

View File

@ -123,7 +123,8 @@ void HttpConnection::sendRequest
void HttpConnection::sendRequest
(std::unique_ptr<HttpRequest> httpRequest)
{
sendRequest(std::move(httpRequest), httpRequest->createRequest());
auto req = httpRequest->createRequest();
sendRequest(std::move(httpRequest), req);
}
void HttpConnection::sendProxyRequest