Reduce code duplication by setting http->ocmd in parse_http_request()
authorFabian Keil <fk@fabiankeil.de>
Tue, 3 Jun 2014 10:25:57 +0000 (10:25 +0000)
committerFabian Keil <fk@fabiankeil.de>
Tue, 3 Jun 2014 10:25:57 +0000 (10:25 +0000)
jcc.c
urlmatch.c

diff --git a/jcc.c b/jcc.c
index 83d1ece..d9960f7 100644 (file)
--- a/jcc.c
+++ b/jcc.c
@@ -1,4 +1,4 @@
-const char jcc_rcs[] = "$Id: jcc.c,v 1.426 2014/06/02 06:19:06 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.427 2014/06/02 06:22:21 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/jcc.c,v $
@@ -924,11 +924,6 @@ static jb_err change_request_destination(struct client_state *csp)
       log_error(LOG_LEVEL_ERROR, "Couldn't parse rewritten request: %s.",
          jb_err_to_string(err));
    }
-   else
-   {
-      /* XXX: ocmd is a misleading name */
-      http->ocmd = strdup_or_die(http->cmd);
-   }
 
    return err;
 }
@@ -1607,10 +1602,6 @@ static jb_err receive_client_request(struct client_state *csp)
       get_url_actions(csp, http);
    }
 
-   /*
-    * Save a copy of the original request for logging
-    */
-   http->ocmd = strdup_or_die(http->cmd);
    enlist(csp->headers, http->cmd);
 
    /* Append the previously read headers */
index 57c538e..c1fc5cb 100644 (file)
@@ -1,4 +1,4 @@
-const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.80 2013/11/24 14:47:45 fabiankeil Exp $";
+const char urlmatch_rcs[] = "$Id: urlmatch.c,v 1.81 2014/05/26 10:48:07 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/urlmatch.c,v $
@@ -543,6 +543,7 @@ jb_err parse_http_request(const char *req, struct http_request *http)
    http->cmd = strdup_or_die(req);
    http->gpc = strdup_or_die(v[0]);
    http->ver = strdup_or_die(v[2]);
+   http->ocmd = strdup_or_die(http->cmd);
 
    freez(buf);