OSDN Git Service

* EAGAIN
authorkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 23 Mar 2008 17:19:27 +0000 (17:19 +0000)
committerkonn <konn@1a406e8e-add9-4483-a2c8-d8cac5b7c224>
Sun, 23 Mar 2008 17:19:27 +0000 (17:19 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/modchxj/mod_chxj/branches/RELEASE_0_9_0@1911 1a406e8e-add9-4483-a2c8-d8cac5b7c224

configure
include/config.h
src/chxj_memcache.c

index 9f5a2db..8ae3191 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for mod_chxj 0.8.8-1.
+# Generated by GNU Autoconf 2.61 for mod_chxj 0.9.0-1.
 #
 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
 # 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='mod_chxj'
 PACKAGE_TARNAME='mod_chxj'
-PACKAGE_VERSION='0.8.8-1'
-PACKAGE_STRING='mod_chxj 0.8.8-1'
+PACKAGE_VERSION='0.9.0-1'
+PACKAGE_STRING='mod_chxj 0.9.0-1'
 PACKAGE_BUGREPORT=''
 
 ac_unique_file="src/mod_chxj.c"
@@ -1405,7 +1405,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures mod_chxj 0.8.8-1 to adapt to many kinds of systems.
+\`configure' configures mod_chxj 0.9.0-1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1476,7 +1476,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mod_chxj 0.8.8-1:";;
+     short | recursive ) echo "Configuration of mod_chxj 0.9.0-1:";;
    esac
   cat <<\_ACEOF
 
@@ -1591,7 +1591,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mod_chxj configure 0.8.8-1
+mod_chxj configure 0.9.0-1
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1605,7 +1605,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mod_chxj $as_me 0.8.8-1, which was
+It was created by mod_chxj $as_me 0.9.0-1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2423,7 +2423,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=mod_chxj
- VERSION=0.8.8-1
+ VERSION=0.9.0-1
 
 
 cat >>confdefs.h <<_ACEOF
@@ -21824,7 +21824,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mod_chxj $as_me 0.8.8-1, which was
+This file was extended by mod_chxj $as_me 0.9.0-1, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21877,7 +21877,7 @@ Report bugs to <bug-autoconf@gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-mod_chxj config.status 0.8.8-1
+mod_chxj config.status 0.9.0-1
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
index a0aaba9..13ebe3b 100644 (file)
 #define PACKAGE_NAME "mod_chxj"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "mod_chxj 0.8.8-1"
+#define PACKAGE_STRING "mod_chxj 0.9.0-1"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "mod_chxj"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "0.8.8-1"
+#define PACKAGE_VERSION "0.9.0-1"
 
 /* Define to 1 if you have the ANSI C header files. */
 #define STDC_HEADERS 1
 
 /* Version number of package */
-#define VERSION "0.8.8-1"
+#define VERSION "0.9.0-1"
 
 /* Define to empty if `const' does not conform to ANSI C. */
 /* #undef const */
index 003ec89..c387e1d 100644 (file)
@@ -109,13 +109,20 @@ chxj_memcache_and_memcache_server_create(request_rec *r, mod_chxj_config *m, apr
 int
 chxj_memcache_set_cookie(request_rec *r, mod_chxj_config *m, const char *cookie_id, const char *store_string)
 {
+  apr_status_t ret;
   apr_uint32_t timeout = (apr_uint32_t) ((m->cookie_timeout) ? m->cookie_timeout : DEFAULT_COOKIE_TIMEOUT);
   DBG(r, "start chxj_memcache_set_cookie()");
 
-  if (apr_memcache_set(mc, cookie_id, (char *)store_string, strlen(store_string), timeout, 0) != APR_SUCCESS) {
-    ERR(r, "failed: apr_memcache_set()");
-    return CHXJ_FALSE;
+  do {
+    if ((ret = apr_memcache_set(mc, cookie_id, (char *)store_string, strlen(store_string), timeout, 0)) != APR_SUCCESS) {
+      if (ret == APR_EAGAIN) {
+        continue;
+      }
+      ERR(r, "failed: apr_memcache_set() ret:[%d]", ret);
+      return CHXJ_FALSE;
+    }
   }
+  while(0);
 
   DBG(r, "end chxj_memcache_set_cookie()");
   return CHXJ_TRUE;
@@ -135,7 +142,7 @@ chxj_memcache_reset_cookie(request_rec *r, mod_chxj_config *m, const char *cooki
     return CHXJ_FALSE;
   }
 
-  if (apr_memcache_set(mc, cookie_id, (char *)store_string, strlen(store_string), timeout, 0) != APR_SUCCESS) {
+  if (! chxj_memcache_set_cookie(r, m, cookie_id, store_string)) {
     ERR(r, "failed: apr_memcache_set()");
     return CHXJ_FALSE;
   }
@@ -154,10 +161,16 @@ chxj_memcache_get_cookie(request_rec *r, mod_chxj_config *UNUSED(m), const char
   apr_status_t ret;
   DBG(r, "start chxj_memcache_get_cookie()");
 
-  if ((ret = apr_memcache_getp(mc, r->pool, cookie_id, &load_string, &len, 0)) != APR_SUCCESS) {
-    ERR(r, "failed: apr_memcache_get() cookie_id:[%s] ret:[%d]", cookie_id, ret);
-    return NULL;
+  do {
+    if ((ret = apr_memcache_getp(mc, r->pool, cookie_id, &load_string, &len, 0)) != APR_SUCCESS) {
+      if (ret == APR_EAGAIN) {
+        continue;
+      }
+      ERR(r, "failed: apr_memcache_get() cookie_id:[%s] ret:[%d]", cookie_id, ret);
+      return NULL;
+    }
   }
+  while(0);
   
   ret_value = apr_palloc(r->pool, len+1);
   memset(ret_value, 0, len+1);
@@ -171,12 +184,19 @@ chxj_memcache_get_cookie(request_rec *r, mod_chxj_config *UNUSED(m), const char
 int
 chxj_memcache_delete_cookie(request_rec *r, mod_chxj_config *UNUSED(m),  const char *cookie_id)
 {
+  apr_status_t ret;
   DBG(r, "start chxj_memcache_delete_cookie()");
 
-  if (apr_memcache_delete(mc, cookie_id, 0) != APR_SUCCESS) {
-    ERR(r, "failed: apr_memcache_delete() cookie_id:[%s]", cookie_id);
-    return CHXJ_FALSE;
+  do {
+    if ((ret = apr_memcache_delete(mc, cookie_id, 0)) != APR_SUCCESS) {
+      if (ret == APR_EAGAIN) {
+        continue;
+      }
+      ERR(r, "failed: apr_memcache_delete() cookie_id:[%s] ret:[%d]", cookie_id, ret);
+      return CHXJ_FALSE;
+    }
   }
+  while(0);
 
   DBG(r, "end chxj_memcache_delete_cookie()");
   return CHXJ_TRUE;