From acdd69c7ba1120ba36ba0899310b592e664c44f2 Mon Sep 17 00:00:00 2001 From: edson-a-soares Date: Mon, 16 Oct 2017 16:38:36 -0300 Subject: [PATCH] Fix ".. has no member named ... compile error" by renaming apache conn_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. --- ApacheConnector/src/ApacheConnector.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ApacheConnector/src/ApacheConnector.cpp b/ApacheConnector/src/ApacheConnector.cpp index b656f8e24d..474b28d6b9 100644 --- a/ApacheConnector/src/ApacheConnector.cpp +++ b/ApacheConnector/src/ApacheConnector.cpp @@ -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); } @@ -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 pRequest(new ApacheServerRequest( + std::unique_ptr 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 pResponse(new ApacheServerResponse(pRequest.get())); + std::unique_ptr pResponse(new ApacheServerResponse(pRequest.get())); // add header information to request rec.copyHeaders(*pRequest); try { - std::auto_ptr pHandler(app.factory().createRequestHandler(*pRequest)); + std::unique_ptr pHandler(app.factory().createRequestHandler(*pRequest)); if (pHandler.get()) {