Changeset 12485 in project for chicken


Ignore:
Timestamp:
11/13/08 07:45:20 (11 years ago)
Author:
Ivan Raikov
Message:

Backporting fixes from trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/chicken-3/tcp.scm

    r10796 r12485  
    612612
    613613(define (##sys#tcp-port->fileno p)
    614   (##sys#slot (##sys#port-data p) 0) )
     614  (let ((data (##sys#port-data p)))
     615    (if (vector? data)                  ; a meagre test, but better than nothing
     616        (##sys#slot data 0)
     617        (error '##sys#tcp-port->fileno "argument does not appear to be a TCP port" p))))
    615618
    616619(define (tcp-addresses p)
     620  (##sys#check-port p 'tcp-addresses)
    617621  (let ((fd (##sys#tcp-port->fileno p)))
    618622    (values
     
    623627
    624628(define (tcp-port-numbers p)
    625  (let ((fd (##sys#tcp-port->fileno p)))
    626    (values
    627     (or (##net#getsockport fd)
    628         (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "can not compute local port - " strerror) p) )
    629     (or (##net#getpeerport fd)
    630         (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "can not compute remote port - " strerror) p) ) ) ) )
     629  (##sys#check-port p 'tcp-port-numbers)
     630  (let ((fd (##sys#tcp-port->fileno p)))
     631    (values
     632     (or (##net#getsockport fd)
     633         (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "can not compute local port - " strerror) p) )
     634     (or (##net#getpeerport fd)
     635         (##sys#signal-hook #:network-error 'tcp-port-numbers (##sys#string-append "can not compute remote port - " strerror) p) ) ) ) )
    631636
    632637(define (tcp-listener-port tcpl)
Note: See TracChangeset for help on using the changeset viewer.