httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_io.c
Date Tue, 22 Jan 2002 06:33:35 GMT
jerenkrantz    02/01/21 22:33:35

  Modified:    modules/ssl ssl_engine_io.c
  Log:
  - Add AP_MODE_SPECULATIVE support to mod_ssl
  - Protect mod_ssl from dealing with modes it doesn't recognize.
  
  Revision  Changes    Path
  1.56      +14 -3     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.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- ssl_engine_io.c	22 Jan 2002 06:26:07 -0000	1.55
  +++ ssl_engine_io.c	22 Jan 2002 06:33:35 -0000	1.56
  @@ -646,6 +646,12 @@
   
       if ((bytes = char_buffer_read(&ctx->cbuf, buf, wanted))) {
           *len = bytes;
  +        if (ctx->inbio.mode == AP_MODE_SPECULATIVE) {
  +            /* We want to rollback this read. */
  +            ctx->cbuf.value -= bytes;
  +            ctx->cbuf.length += bytes;
  +            return APR_SUCCESS;
  +        } 
           if ((*len >= wanted) || ctx->inbio.mode == AP_MODE_GETLINE) {
               return APR_SUCCESS;
           }
  @@ -655,6 +661,9 @@
   
       if (rc > 0) {
           *len += rc;
  +        if (ctx->inbio.mode == AP_MODE_SPECULATIVE) {
  +            char_buffer_write(&ctx->cbuf, buf, rc);
  +        }
       }
   
       return ctx->inbio.rc;
  @@ -736,8 +745,9 @@
       apr_off_t bytes = *readbytes;
       int is_init = (mode == AP_MODE_INIT);
   
  -    /* XXX: we don't currently support peek or readbytes == -1 */
  -    if (mode == AP_MODE_EATCRLF || *readbytes == -1) {
  +    /* XXX: we don't currently support anything other than these modes. */
  +    if (mode != AP_MODE_READBYTES && mode != AP_MODE_GETLINE && 
  +        mode != AP_MODE_SPECULATIVE && mode != AP_MODE_INIT) {
           return APR_ENOTIMPL;
       }
   
  @@ -762,7 +772,8 @@
           return APR_SUCCESS;
       }
   
  -    if (ctx->inbio.mode == AP_MODE_READBYTES) {
  +    if (ctx->inbio.mode == AP_MODE_READBYTES || 
  +        ctx->inbio.mode == AP_MODE_SPECULATIVE) {
           /* Protected from truncation, bytes < MAX_SIZE_T */
           if (bytes < len) {
               len = (apr_size_t)bytes;
  
  
  

Mime
View raw message