Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

When a expire was not set on a ticket, made modifications to use the …

…default value.
  • Loading branch information...
commit 6aac162825f821fa4987833596715ed255845f58 1 parent caeb040
Yuusuke Iida authored
Showing with 8 additions and 3 deletions.
  1. +8 −1 src/config.c
  2. +0 −2  src/ticket.c
View
9 src/config.c
@@ -22,6 +22,7 @@
#include <string.h>
#include "booth.h"
#include "config.h"
+#include "ticket.h"
#include "log.h"
static int ticket_size = 0;
@@ -220,8 +221,14 @@ int read_config(const char *path)
}
expiry = index(val, ';');
weight = rindex(val, ';');
- if (!expiry)
+ if (!expiry) {
strcpy(booth_conf->ticket[count].name, val);
+ booth_conf->ticket[count].expiry = DEFAULT_TICKET_EXPIRY;
+ log_info("expire is not set in %s."
+ " Set the default value %ds.",
+ booth_conf->ticket[count].name,
+ DEFAULT_TICKET_EXPIRY);
+ }
else if (expiry && expiry == weight) {
*expiry++ = '\0';
while (*expiry == ' ')
View
2  src/ticket.c
@@ -540,8 +540,6 @@ int setup_ticket(void)
strcpy(tk->id, booth_conf->ticket[i].name);
tk->owner = -1;
tk->expiry = booth_conf->ticket[i].expiry;
- if (!tk->expiry)
- tk->expiry = DEFAULT_TICKET_EXPIRY;
list_add_tail(&tk->list, &ticket_list);
plh = paxos_lease_init(tk->id,
Please sign in to comment.
Something went wrong with that request. Please try again.