Skip to content

Commit

Permalink
Fix ".. has no member named ... compile error" by renaming apache con…
Browse files Browse the repository at this point in the history
…n_rec

attributes

 - conn_rec attributes remote_ip and remote_addr were replaced by client_ip
 and client_addr once they have been renamed in Apache 2.4
 - a server_rec pointer must be passed to ap_log_error() since apache 2.4,
 therefore, a change was necessary at the ap_log_error log function.
 A null pointer has been passed for avoiding deeper changes at the function.
 - the smart pointer auto_ptr was replaced by unique_ptr once it was made
 deprecated in C++11 standard, it has been replaced by unique_ptr.
  • Loading branch information
edson-a-soares committed Oct 16, 2017
1 parent 071cdd1 commit acdd69c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ApacheConnector/src/ApacheConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void ApacheRequestRec::copyHeaders(ApacheServerRequest& request)

void ApacheConnector::log(const char* file, int line, int level, int status, const char *text)
{
ap_log_error(file, line, level, 0, NULL, "%s", text);
ap_log_error(file, line, level, 0, NULL, 0, text);
}


Expand All @@ -172,21 +172,21 @@ extern "C" int ApacheConnector_handler(request_rec *r)
if ((rv = ap_setup_client_block(r, REQUEST_CHUNKED_DECHUNK)))
return rv;

std::auto_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
std::unique_ptr<ApacheServerRequest> pRequest(new ApacheServerRequest(
&rec,
r->connection->local_ip,
r->connection->local_addr->port,
r->connection->remote_ip,
r->connection->remote_addr->port));
r->connection->client_ip,
r->connection->client_addr->port));

std::auto_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));
std::unique_ptr<ApacheServerResponse> pResponse(new ApacheServerResponse(pRequest.get()));

// add header information to request
rec.copyHeaders(*pRequest);

try
{
std::auto_ptr<HTTPRequestHandler> pHandler(app.factory().createRequestHandler(*pRequest));
std::unique_ptr<HTTPRequestHandler> pHandler(app.factory().createRequestHandler(*pRequest));

if (pHandler.get())
{
Expand Down

0 comments on commit acdd69c

Please sign in to comment.