You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)" <ma...@hp.com> on 2003/02/21 03:05:39 UTC

[PATCH] RE: Problem with SSL in 64 bit build on Solaris

>-----Original Message-----
>From: William A. Rowe, Jr. [mailto:wrowe@rowe-clan.net]
>>inl happens to be a 'int' type, and apr_size_t is a 'long'.. 
>
>I patterned brigade_consume after brigade_read.  Personally, 
>I'd like to see
>inl become apr_size_t, v.s. the alternative.
>

It's trying to ensure that both apache and openssl are happy :). Given the
limitation that OpenSSL gives us a int, and we want to go the apr_size_t
route, here's the patch I have.

I know some ppl may not like it because of the casting - but, can we live
with this ?. The other way is to change brigade_consume, to accept (int *)
rather than (apr_size_t *). [I think it's more cleaner]


Index: ssl_engine_io.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/ssl/ssl_engine_io.c,v
retrieving revision 1.103
diff -u -r1.103 ssl_engine_io.c
--- ssl_engine_io.c     3 Feb 2003 17:53:12 -0000       1.103
+++ ssl_engine_io.c     21 Feb 2003 01:59:32 -0000
@@ -479,8 +479,9 @@
 /*
  * this is the function called by SSL_read()
  */
-static int bio_filter_in_read(BIO *bio, char *in, int inl)
+static int bio_filter_in_read(BIO *bio, char *in, int inlen)
 {
+    apr_size_t inl = inlen;
     bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)(bio->ptr);
     apr_read_type_e block = inctx->block;
     SSLConnRec *sslconn = myConnConfig(inctx->f->c);
@@ -536,13 +537,13 @@
     inctx->rc = brigade_consume(inctx->bb, block, in, &inl);
 
     if (inctx->rc == APR_SUCCESS) {
-        return inl;
+        return (int)inl;
     }
 
     if (APR_STATUS_IS_EAGAIN(inctx->rc) 
             || APR_STATUS_IS_EINTR(inctx->rc)) {
         BIO_set_retry_read(bio);
-        return inl;
+        return (int)inl;
     }
         
     /* Unexpected errors and APR_EOF clean out the brigade.
@@ -555,7 +556,7 @@
         /* Provide the results of this read pass,
          * without resetting the BIO retry_read flag
          */
-        return inl;
+        return (int)inl;
     }
 
     return -1;