Changeset 25860 in project


Ignore:
Timestamp:
02/04/12 17:54:05 (8 years ago)
Author:
sjamaan
Message:

spiffy: Don't use raw slot accessors to determine whether a port is an SSL port and extract the TCP port from it; this broke when openssl changed its internal port representation in 1.6.1. Thanks to Thomas Chust for providing a fix and Mario Goulart for testing it

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/spiffy/trunk/spiffy.scm

    r25141 r25860  
    537537        (begin (mutex-unlock! m condition) (retry)))))
    538538
    539 ;; From the openssl egg.  This is a way to support SSL without *requiring* it.
    540 (define (ssl-port? obj)
    541   (and (port? obj) (eq? (##sys#slot obj 10) 'ssl-socket)))
    542 
    543 (define (ssl-port->tcp-port p)
    544   (if (ssl-port? p) (##sys#slot p 11) (error "Expected an SSL port")))
     539;; Imports from the openssl egg, if available
     540(define (dynamic-import module symbol default)
     541  (handle-exceptions _ default (eval `(let () (use ,module) ,symbol))))
     542
     543(define ssl-port?
     544  (dynamic-import
     545   'openssl 'ssl-port?
     546   (lambda (v)
     547     #f)))
     548
     549(define ssl-port->tcp-port
     550  (dynamic-import
     551   'openssl 'ssl-port->tcp-port
     552   (lambda (v) (error 'ssl-port->tcp-port "Expected an SSL port" v))))
    545553
    546554(define (ssl-or-tcp-addresses p)
Note: See TracChangeset for help on using the changeset viewer.