chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] Problem with OpenSSL and file descriptors (sendfil


From: Peter Bex
Subject: Re: [Chicken-hackers] Problem with OpenSSL and file descriptors (sendfile)
Date: Sun, 4 Jul 2010 15:17:14 +0200
User-agent: Mutt/1.4.2.3i

On Sun, Jul 04, 2010 at 02:59:14PM +0200, Thomas Chust wrote:
> Hello,
> 
> this looks alright to me. I have three small remarks:
> 
>  * I would suggest renaming ssl-port->tcp-fd into ssl-port->tcp-port,
>    since it doesn't return a file descriptor, but rather another
>    port.

Whoops, that's something I forgot.  I started out with this but changed
it to return the port instead of the fd but forgot to rename the proc.

>  * I think ssl-port->tcp-port should be exported from the openssl
>    module. That way it would be possible for client code to call
>    (port->fileno (ssl-port->tcp-port ...)) and use the result in a
>    call to file-select or some other low level status inquiry that
>    requires a file descriptor, which may be useful.

Hm, good point.  Should it still define ssl-addresses then?  It's
redundant since user code could do (tcp-addresses (ssl-port->tcp-port p))
manually.

>  * To avoid code duplication I would consider replacing the manual
>    definition of ensure-ssl-port with a use of the check-errors egg,
>    ie. to write (define-check+error-type ssl-port), export
>    check-ssl-port and error-ssl-port as well as ssl-port? and use
>    check-ssl-port instead of ensure-ssl-port.

I don't agree here.  Using check-errors would make some sense, but would
introduce a dependency (openssl didn't require any other eggs up till now)
while the checking code isn't that big.  If it did a lot more checking I
would see the point in it, but not now.

Also, why should it export the checking procedures?  I don't know of any
other type or egg that has such checking procedures exported.  It's only
of marginal use to openssl-using code.

Cheers,
Peter
-- 
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
                                                        -- Donald Knuth



reply via email to

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