------------------------------------------------------------ revno: 13311 revision-id: squid3@treenet.co.nz-20140314092631-qr3whs3jphrfyn8q parent: rousskov@measurement-factory.com-20140313211147-q0chvbamljkck2g1 committer: Amos Jeffries branch nick: trunk timestamp: Fri 2014-03-14 22:26:31 +1300 message: Remove useless code after rev.13309 The state variables used to store and present the redirector and store_id helper parameters is no longer necessary. Detected by Coverity Scan. Issue 1191964. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20140314092631-qr3whs3jphrfyn8q # target_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # testament_sha1: 439c7e081d88a4fd0954fa13cccdac34abe0b588 # timestamp: 2014-03-14 10:01:59 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/trunk/ # base_revision_id: rousskov@measurement-factory.com-20140313211147-\ # q0chvbamljkck2g1 # # Begin patch === modified file 'src/redirect.cc' --- src/redirect.cc 2014-03-13 10:56:38 +0000 +++ src/redirect.cc 2014-03-14 09:26:31 +0000 @@ -37,7 +37,6 @@ #include "client_side_request.h" #include "comm/Connection.h" #include "fde.h" -#include "fqdncache.h" #include "format/Format.h" #include "globals.h" #include "HttpRequest.h" @@ -66,9 +65,6 @@ void *data; SBuf orig_url; - Ip::Address client_addr; - const char *client_ident; - const char *method_s; HLPCB *handler; private: @@ -91,9 +87,6 @@ RedirectStateData::RedirectStateData(const char *url) : data(NULL), orig_url(url), - client_addr(), - client_ident(NULL), - method_s(NULL), handler(NULL) { } @@ -238,8 +231,6 @@ static void constructHelperQuery(const char *name, helper *hlp, HLPCB *replyHandler, ClientHttpRequest * http, HLPCB *handler, void *data, Format::Format *requestExtrasFmt) { - ConnStateData * conn = http->getConn(); - const char *fqdn; char buf[MAX_REDIRECTOR_REQUEST_STRLEN]; int sz; Http::StatusCode status; @@ -248,48 +239,9 @@ * the RedirectStateData for all the helpers. */ RedirectStateData *r = new RedirectStateData(http->uri); - if (conn != NULL) - r->client_addr = conn->log_addr; - else - r->client_addr.setNoAddr(); - r->client_ident = NULL; -#if USE_AUTH - if (http->request->auth_user_request != NULL) { - r->client_ident = http->request->auth_user_request->username(); - debugs(61, 5, HERE << "auth-user=" << (r->client_ident?r->client_ident:"NULL")); - } -#endif - - if (!r->client_ident && http->request->extacl_user.size() > 0) { - r->client_ident = http->request->extacl_user.termedBuf(); - debugs(61, 5, HERE << "acl-user=" << (r->client_ident?r->client_ident:"NULL")); - } - - if (!r->client_ident && conn != NULL && conn->clientConnection != NULL && conn->clientConnection->rfc931[0]) { - r->client_ident = conn->clientConnection->rfc931; - debugs(61, 5, HERE << "ident-user=" << (r->client_ident?r->client_ident:"NULL")); - } - -#if USE_SSL - - if (!r->client_ident && conn != NULL && Comm::IsConnOpen(conn->clientConnection)) { - r->client_ident = sslGetUserEmail(fd_table[conn->clientConnection->fd].ssl); - debugs(61, 5, HERE << "ssl-user=" << (r->client_ident?r->client_ident:"NULL")); - } -#endif - - if (!r->client_ident) - r->client_ident = dash_str; - - r->method_s = RequestMethodStr(http->request->method); - r->handler = handler; - r->data = cbdataReference(data); - if ((fqdn = fqdncache_gethostbyaddr(r->client_addr, 0)) == NULL) - fqdn = dash_str; - static MemBuf requestExtras; requestExtras.reset(); if (requestExtrasFmt)