From 6a57c02278c19ce626b371507a34387c738fd791 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Mon, 12 Mar 2012 19:06:31 +0100 Subject: [PATCH] Fix accept-connection to return the remote port as third value --- src/sockets/base-sockets.lisp | 3 ++- src/sockets/socket-methods.lisp | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sockets/base-sockets.lisp b/src/sockets/base-sockets.lisp index dab3c99..53d9a3b 100644 --- a/src/sockets/base-sockets.lisp +++ b/src/sockets/base-sockets.lisp @@ -247,7 +247,8 @@ specifies a timeout in seconds and T means \"wait forever\". EXTERNAL-FORMAT optionally specifies the external format of the new socket - the default being that of SOCKET. Buffer sizes for the new socket can also be specified using INPUT-BUFFER-SIZE and OUTPUT-BUFFER-SIZE. -If a connection is received, returns two values: the newly created socket and the remote host address.")) +If a connection is received, returns two or three values: the newly created socket, the remote peer +address and the remote port if applicable.")) (defclass socket-stream-internet-active (active-socket stream-socket internet-socket) () diff --git a/src/sockets/socket-methods.lisp b/src/sockets/socket-methods.lisp index efe6f39..01873c4 100644 --- a/src/sockets/socket-methods.lisp +++ b/src/sockets/socket-methods.lisp @@ -290,8 +290,9 @@ (ignore-some-conditions (isys:ewouldblock iomux:poll-timeout) (iomux:wait-until-fd-ready (fd-of socket) :input (wait->timeout wait) t) (with-sockaddr-storage-and-socklen (ss size) - (values (make-client-socket (%accept (fd-of socket) ss size)) - (sockaddr-storage->sockaddr ss)))))) + (multiple-value-call #'values + (make-client-socket (%accept (fd-of socket) ss size)) + (sockaddr-storage->sockaddr ss)))))) ;;;------------------------------------------------------------------------- -- 2.11.4.GIT