httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r546708 - /httpd/httpd/trunk/modules/ssl/ssl_scache_memcache.c
Date Wed, 13 Jun 2007 02:18:59 GMT
Author: pquerna
Date: Tue Jun 12 19:18:59 2007
New Revision: 546708

URL: http://svn.apache.org/viewvc?view=rev&rev=546708
Log:
Improve mc_session_id2sz as suggested by RĂ¼diger.

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_scache_memcache.c

Modified: httpd/httpd/trunk/modules/ssl/ssl_scache_memcache.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_scache_memcache.c?view=diff&rev=546708&r1=546707&r2=546708
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_scache_memcache.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_scache_memcache.c Tue Jun 12 19:18:59 2007
@@ -168,13 +168,16 @@
 {
     char *cp;
     int n;
- 
+    int maxlen = (strsize - MC_TAG_LEN)/2;
+
     cp = apr_cpystrn(str, MC_TAG, MC_TAG_LEN);
-    for (n = 0; n < idlen && n < (MC_KEY_LEN - MC_TAG_LEN); n++) {
-        apr_snprintf(cp, strsize - (cp-str), "%02X", id[n]);
+    for (n = 0; n < idlen && n < maxlen; n++) {
+        apr_snprintf(cp, 2, "%02X", id[n]);
         cp += 2;
     }
+
     *cp = '\0';
+
     return str;
 }
 



Mime
View raw message