From 3bf236a994cf33dce3e88b8eb1f93e46635adc08 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Sun, 11 Nov 2012 12:37:42 +0000
Subject: [PATCH] Only call time() in server_set_cookie() if the time is
 actually needed

---
 parsers.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/parsers.c b/parsers.c
index 710cccee..9f58a9d7 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.260 2012/10/29 12:04:42 fabiankeil Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.261 2012/11/09 10:46:06 fabiankeil Exp $";
 /*********************************************************************
  *
  * File        :  $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -3833,8 +3833,6 @@ static jb_err server_set_cookie(struct client_state *csp, char **header)
    time_t now;
    time_t cookie_time;
 
-   time(&now);
-
    if ((csp->action->flags & ACTION_CRUNCH_INCOMING_COOKIES) != 0)
    {
       log_error(LOG_LEVEL_HEADER, "Crunching incoming cookie: %s", *header);
@@ -3857,6 +3855,8 @@ static jb_err server_set_cookie(struct client_state *csp, char **header)
          cur_tag++;
       }
 
+      time(&now);
+
       /* Loop through each tag in the cookie */
       while (*cur_tag)
       {
-- 
2.49.0