You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2003/05/16 18:11:07 UTC

cvs commit: httpd-2.0/modules/ssl ssl_engine_io.c

wrowe       2003/05/16 09:11:04

  Modified:    modules/ssl ssl_engine_io.c
  Log:
    Assure that we block on the read BIO when we invoke the read BIO for both
    first-use cases (via ssl_io_input_add_filter) and when we are writing and
    need response from the client (via ssl_io_filter_output).  Both of these
    cases are always blocking.  [
  
  PR: 19242
  Submitted by:	David Deaves <Da...@dd.id.au>, William Rowe
  
  Revision  Changes    Path
  1.106     +14 -4     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.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- ssl_engine_io.c	5 Apr 2003 19:04:44 -0000	1.105
  +++ ssl_engine_io.c	16 May 2003 16:11:03 -0000	1.106
  @@ -1358,6 +1358,8 @@
   {
       apr_status_t status = APR_SUCCESS;
       ssl_filter_ctx_t *filter_ctx = f->ctx;
  +    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)
  +                                 (filter_ctx->pbioRead->ptr);
   
       if (f->c->aborted) {
           apr_brigade_cleanup(bb);
  @@ -1369,6 +1371,13 @@
           return ap_pass_brigade(f->next, bb);
       }
   
  +    /* When we are the writer, we must initialize the inctx
  +     * mode so that we block for any required ssl input, because
  +     * output filtering is always nonblocking.
  +     */
  +    inctx->mode = APR_MODE_READBYTES;
  +    inctx->block = AP_BLOCK_READ;
  +
       if ((status = ssl_io_filter_connect(filter_ctx)) != APR_SUCCESS) {
           return ssl_io_filter_error(f, bb, status);
       }
  @@ -1442,15 +1451,16 @@
       filter_ctx->pbioRead = BIO_new(&bio_filter_in_method);
       filter_ctx->pbioRead->ptr = (void *)inctx;
   
  -    inctx->filter_ctx = filter_ctx;
       inctx->ssl = ssl;
       inctx->bio_out = filter_ctx->pbioWrite;
       inctx->f = filter_ctx->pInputFilter;
  -    inctx->bb = apr_brigade_create(c->pool, c->bucket_alloc);
  -
  +    inctx->rc = APR_SUCCESS;
  +    inctx->mode = AP_MODE_READBYTES;
       inctx->cbuf.length = 0;
  -
  +    inctx->bb = apr_brigade_create(c->pool, c->bucket_alloc);
  +    inctx->block = APR_BLOCK_READ;
       inctx->pool = c->pool;
  +    inctx->filter_ctx = filter_ctx;
   }
   
   void ssl_io_filter_init(conn_rec *c, SSL *ssl)