You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by do...@apache.org on 2002/03/15 02:46:47 UTC

cvs commit: httpd-2.0/modules/ssl ssl_scache_shmcb.c ssl_util_table.c

dougm       02/03/14 17:46:47

  Modified:    modules/ssl ssl_scache_shmcb.c ssl_util_table.c
  Log:
  get rid of some -Wall warnings
  
  Revision  Changes    Path
  1.7       +3 -0      httpd-2.0/modules/ssl/ssl_scache_shmcb.c
  
  Index: ssl_scache_shmcb.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_scache_shmcb.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ssl_scache_shmcb.c	14 Mar 2002 23:31:23 -0000	1.6
  +++ ssl_scache_shmcb.c	15 Mar 2002 01:46:47 -0000	1.7
  @@ -269,10 +269,13 @@
   
   /* This is necessary simply so that the size passed to memset() is not a
    * compile-time constant, preventing the compiler from optimising it. */
  +#if 0
  +/* XXX: this isn't used, is it needed? */
   static void shmcb_safe_clear(void *ptr, size_t size)
   {
   	memset(ptr, 0, size);
   }
  +#endif
   
   /* Underlying functions for session-caching */
   static BOOL shmcb_init_memory(server_rec *, void *, unsigned int);
  
  
  
  1.7       +2 -0      httpd-2.0/modules/ssl/ssl_util_table.c
  
  Index: ssl_util_table.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_util_table.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ssl_util_table.c	14 Mar 2002 23:31:23 -0000	1.6
  +++ ssl_util_table.c	15 Mar 2002 01:46:47 -0000	1.7
  @@ -989,7 +989,9 @@
    */
   int table_clear(table_t * table_p)
   {
  +#if 0
       table_entry_t *entry_p, *next_p;
  +#endif
       table_entry_t **bucket_p, **bounds_p;
   
       if (table_p == NULL)
  
  
  

Re: cvs commit: httpd-2.0/modules/ssl ssl_scache_shmcb.c ssl_util_table.c

Posted by Joe Orton <jo...@redhat.com>.
On Fri, Mar 15, 2002 at 01:46:47AM -0000, dougm@apache.org wrote:
>    /* This is necessary simply so that the size passed to memset() is not a
>     * compile-time constant, preventing the compiler from optimising it. */
>   +#if 0
>   +/* XXX: this isn't used, is it needed? */
>    static void shmcb_safe_clear(void *ptr, size_t size)
>    {
>    	memset(ptr, 0, size);
>    }
>   +#endif

It was needed in mod_ssl 2.8 as in the below patch, since 'idx' wasn't
guaranteed to be word-aligned, and some compilers would optimise the
memset into instructions which operated on words. If you can guarantee
that idx is word-aligned in 2.0 with the new rmm stuff, it probably
isn't needed.

Index: ssl_scache_shmcb.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/ssl/ssl_scache_shmcb.c,v
retrieving revision 1.7
diff -u -r1.7 ssl_scache_shmcb.c
--- ssl_scache_shmcb.c	15 Mar 2002 01:46:47 -0000	1.7
+++ ssl_scache_shmcb.c	15 Mar 2002 08:49:02 -0000
@@ -269,13 +269,10 @@
 
 /* This is necessary simply so that the size passed to memset() is not a
  * compile-time constant, preventing the compiler from optimising it. */
-#if 0
-/* XXX: this isn't used, is it needed? */
 static void shmcb_safe_clear(void *ptr, size_t size)
 {
 	memset(ptr, 0, size);
 }
-#endif
 
 /* Underlying functions for session-caching */
 static BOOL shmcb_init_memory(server_rec *, void *, unsigned int);
@@ -1178,7 +1175,7 @@
                 "internal error");
         return FALSE;
     }
-    memset(idx, 0, sizeof(SHMCBIndex));
+    shmcb_safe_clear(idx, sizeof(SHMCBIndex));
     shmcb_set_safe_time(&(idx->expires), expiry_time);
     shmcb_set_safe_uint(&(idx->offset), new_offset);