httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/modules/http http_protocol.c
Date Thu, 22 Nov 2001 21:04:28 GMT
brianp      01/11/22 13:04:28

  Modified:    modules/http http_protocol.c
  Log:
  added inlined string concatenation to form_header_field() for speed
  
  Revision  Changes    Path
  1.380     +16 -2     httpd-2.0/modules/http/http_protocol.c
  
  Index: http_protocol.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/http/http_protocol.c,v
  retrieving revision 1.379
  retrieving revision 1.380
  diff -u -r1.379 -r1.380
  --- http_protocol.c	2001/11/08 19:35:32	1.379
  +++ http_protocol.c	2001/11/22 21:04:28	1.380
  @@ -749,9 +749,23 @@
   {
       char *headfield;
       apr_size_t len;
  +    apr_size_t name_len;
  +    apr_size_t val_len;
  +    char *next;
   
  -    headfield = apr_pstrcat(h->pool, fieldname, ": ", fieldval, CRLF, NULL);
  -    len = strlen(headfield);
  +    name_len = strlen(fieldname);
  +    val_len = strlen(fieldval);
  +    len = name_len + val_len + 4; /* 4 for ": " plus CRLF */
  +    headfield = (char *)apr_palloc(h->pool, len + 1);
  +    memcpy(headfield, fieldname, name_len);
  +    next = headfield + name_len;
  +    *next++ = ':';
  +    *next++ = ' ';
  +    memcpy(next, fieldval, val_len);
  +    next += val_len;
  +    *next++ = CR;
  +    *next++ = LF;
  +    *next = 0;
       ap_xlate_proto_to_ascii(headfield, len);
       apr_brigade_write(h->bb, NULL, NULL, headfield, len);
       return 1;
  
  
  

Mime
View raw message