httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_io.c
Date Thu, 14 Mar 2002 07:04:10 GMT
dougm       02/03/13 23:04:10

  Modified:    modules/ssl ssl_engine_io.c
  Log:
  fix bug in ssl_io_input_getline():
  in most cases we get all the headers on the first SSL_read.
  however, in certain cases SSL_read will only get a partial
  chunk of the headers, so we now try to read until LF is seen.
  
  bug seen with netscape client (running both on linux and win32) and
  server running on win32.
  
  Revision  Changes    Path
  1.59      +25 -5     httpd-2.0/modules/ssl/ssl_engine_io.c
  
  Index: ssl_engine_io.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_io.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- ssl_engine_io.c	13 Mar 2002 20:47:54 -0000	1.58
  +++ ssl_engine_io.c	14 Mar 2002 07:04:10 -0000	1.59
  @@ -674,16 +674,36 @@
                                            char *buf,
                                            apr_size_t *len)
   {
  -    const char *pos;
  +    const char *pos = NULL;
       apr_status_t status;
  +    apr_size_t tmplen = *len, buflen = *len, offset = 0;
   
  -    status = ssl_io_input_read(ctx, buf, len);
  +    *len = 0;
   
  -    if (status != APR_SUCCESS) {
  -        return status;
  +    /*
  +     * in most cases we get all the headers on the first SSL_read.
  +     * however, in certain cases SSL_read will only get a partial
  +     * chunk of the headers, so we try to read until LF is seen.
  +     * /
  +
  +    while (tmplen > 0) {
  +        status = ssl_io_input_read(ctx, buf + offset, &tmplen);
  +        
  +        if (status != APR_SUCCESS) {
  +            return status;
  +        }
  +
  +        *len += tmplen;
  +
  +        if ((pos = memchr(buf, APR_ASCII_LF, *len))) {
  +            break;
  +        }
  +
  +        offset += tmplen;
  +        tmplen = buflen - offset;
       }
   
  -    if ((pos = memchr(buf, APR_ASCII_LF, *len))) {
  +    if (pos) {
           char *value;
           int length;
           apr_size_t bytes = pos - buf;
  
  
  

Mime
View raw message