chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] OpenSSL egg option defaults poll


From: Andy Bennett
Subject: Re: [Chicken-users] OpenSSL egg option defaults poll
Date: Sun, 23 Nov 2014 13:17:49 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Icedove/24.8.1

Hi,

>> * substring/shared is the same as substring in CHICKEN, AFAIK.
> 
> That's only called once in the corner cases so it doesn't really matter
> if it wastes a copy. It's just there to stop junk in the tail of the
> buffer being sent to the user.

Attached is new version of my patch which avoids the use of
substring/shared.

Below is a diff between the code with my previous patch and the code
with this new patch.

-----
diff -upr v1.6.4-andyjpb-fix/openssl.scm v1.6.4-andyjpb-fix-2/openssl.scm
--- v1.6.4-andyjpb-fix/openssl.scm      2014-11-23 02:31:54.004264327 +0000
+++ v1.6.4-andyjpb-fix-2/openssl.scm    2014-11-23 13:10:43.801483458 +0000
@@ -446,9 +446,9 @@ EOF
             (outbuf     (and outbufmax (fx> outbufmax 0) (make-string
outbufmax)))
             (outbufsize 0)
             (unbuffered-write
-              (lambda (buffer)
-               (when (> (##sys#size buffer) 0) ; Undefined behaviour
for 0 bytes!
-                 (let loop ((offset 0) (size (##sys#size buffer)))
+              (lambda (buffer #!optional (offset 0) (size (##sys#size
buffer)))
+               (when (> size 0) ; Undefined behaviour for 0 bytes!
+                 (let loop ((offset offset) (size size))
                    (let ((ret (ssl-call/timeout
                                'ssl-write
                                (lambda () (ssl-write ssl buffer offset
size))
@@ -484,7 +484,7 @@ EOF
           (when (startup #t)
             (if outbuf
               (begin
-                (unbuffered-write (substring/shared outbuf 0 outbufsize))
+                (unbuffered-write outbuf 0 outbufsize)
                 (set! outbufsize 0)))
             (set! out-open? #f)
             (shutdown)))
@@ -492,7 +492,7 @@ EOF
         (lambda ()
           (when outbuf
             (startup)
-            (unbuffered-write (substring/shared outbuf 0 outbufsize))
+            (unbuffered-write outbuf 0 outbufsize)
             (set! outbufsize 0)))))))
       (##sys#setslot in 3 "(ssl)")
       (##sys#setslot out 3 "(ssl)")
-----






Regards,
@ndy

-- 
address@hidden
http://www.ashurst.eu.org/
0x7EBA75FF

Attachment: openssl-egg-andyjpb-fix-2014-11-23-2.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]