Skip to content

Commit

Permalink
Releasing 1.1.8 bugfix release.
Browse files Browse the repository at this point in the history
Avva:

The below fixes the bug. There was a conflict between the usual meaning of
exptime=0 (don't expire) and the new fancy let-exptime-be-used-as-delta
stuff.


git-svn-id: http://code.sixapart.com/svn/memcached/trunk@79 b0b603af-a30f-0410-a34e-baf09ae79d0b
  • Loading branch information
bradfitz committed Jul 30, 2003
1 parent 4ae59c5 commit bfebefb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion ChangeLog
@@ -1,6 +1,8 @@
2003-07-29
* version 1.1.7

* big bug fix: item exptime 0 meant expire immediately, not never
* version 1.1.8

2003-07-22
* make 'delete' take second arg, of time to refuse new add/replace
* set/add/replace/delete can all take abs or delta time (delta can't
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
@@ -1,5 +1,5 @@
AC_PREREQ(2.52)
AC_INIT(memcached, 1.1.7, brad@danga.com)
AC_INIT(memcached, 1.1.8, brad@danga.com)
AC_CONFIG_SRCDIR(memcached.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_CONFIG_HEADER(config.h)
Expand Down
9 changes: 7 additions & 2 deletions memcached.c
Expand Up @@ -47,14 +47,19 @@ static int delcurr;
static int deltotal;

time_t realtime(time_t exptime) {
time_t now = time(0);
time_t now;

/* no. of seconds in 30 days - largest possible delta exptime */
#define REALTIME_MAXDELTA 60*60*24*30

if (exptime == 0) return 0; /* 0 means never expire */

if (exptime > REALTIME_MAXDELTA)
return exptime;
else return exptime + now;
else {
now = time(0);
return exptime + now;
}
}

void stats_init(void) {
Expand Down

0 comments on commit bfebefb

Please sign in to comment.