httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: httpd-2.0/modules/tls mod_tls.c
Date Mon, 12 Feb 2001 02:55:52 GMT
gstein      01/02/11 18:55:52

  Modified:    include  apr_strings.h
               strings  apr_strings.c
               modules/tls mod_tls.c
  Log:
  *) rename apr_memdup() to apr_pmemdup()
  *) optimize the allocation size in apr_pstrndup()
  
  Revision  Changes    Path
  1.12      +2 -1      apr/include/apr_strings.h
  
  Index: apr_strings.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_strings.h,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -u -r1.11 -r1.12
  --- apr_strings.h	2001/02/11 16:18:08	1.11
  +++ apr_strings.h	2001/02/12 02:55:52	1.12
  @@ -144,8 +144,9 @@
    * @param m The memory to duplicate
    * @param n The number of bytes to duplicate
    * @return The new block of memory
  + * @deffunc void *apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n)
    */
  -APR_DECLARE(void *) apr_memdup(apr_pool_t *p, const void *m, apr_size_t n);
  +APR_DECLARE(void *) apr_pmemdup(apr_pool_t *p, const void *m, apr_size_t n);
   
   /**
    * Concatenate multiple strings, allocating memory out a pool
  
  
  
  1.10      +7 -8      apr/strings/apr_strings.c
  
  Index: apr_strings.c
  ===================================================================
  RCS file: /home/cvs/apr/strings/apr_strings.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -u -r1.9 -r1.10
  --- apr_strings.c	2001/02/11 16:25:07	1.9
  +++ apr_strings.c	2001/02/12 02:55:52	1.10
  @@ -88,21 +88,20 @@
       if (s == NULL) {
           return NULL;
       }
  -    res = apr_palloc(a, n + 1);
       len = strlen(s);
  -    if(len > n) {
  -	memcpy(res, s, n);
  -	res[n] = '\0';
  -    } else
  -	memcpy(res, s, len+1);
  +    if (len < n)
  +        n = len;
  +    res = apr_palloc(a, n + 1);
  +    memcpy(res, s, n);
  +    res[n] = '\0';
       return res;
   }
   
  -APR_DECLARE(void *) apr_memdup(apr_pool_t *a, const void *m, apr_size_t n)
  +APR_DECLARE(void *) apr_pmemdup(apr_pool_t *a, const void *m, apr_size_t n)
   {
       void *res;
   
  -    if(m == NULL)
  +    if (m == NULL)
   	return NULL;
       res = apr_palloc(a, n);
       memcpy(res, m, n);
  
  
  
  1.3       +1 -1      httpd-2.0/modules/tls/mod_tls.c
  
  Index: mod_tls.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/tls/mod_tls.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- mod_tls.c	2001/02/11 21:47:41	1.2
  +++ mod_tls.c	2001/02/12 02:55:52	1.3
  @@ -267,7 +267,7 @@
   	    apr_bucket *pbktOut;
   	    char *pbuf;
   
  -	    pbuf=apr_memdup(pCtx->pInputFilter->c->pool,buf,n);
  +	    pbuf=apr_pmemdup(pCtx->pInputFilter->c->pool,buf,n);
   	    // XXX: should we use a heap bucket instead? Or a transient (in
   	    // which case we need a separate brigade for each bucket)?
   	    pbktOut=apr_bucket_pool_create(pbuf,n,pCtx->pInputFilter->c->pool);
  
  
  

Mime
View raw message