From 3ff658e3a7f866aefd73989e17c6376b23dd08b8 Mon Sep 17 00:00:00 2001
From: Alex Shinn <ashinn@users.noreply.github.com>
Date: Sat, 6 Aug 2011 15:22:17 +0900
Subject: [PATCH] Forgot to use the addrinfo if supplied.

---
 lib/chibi/net.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lib/chibi/net.scm b/lib/chibi/net.scm
index e0aa14a1..7a448f92 100644
--- a/lib/chibi/net.scm
+++ b/lib/chibi/net.scm
@@ -11,9 +11,11 @@
 (define (get-address-info host service . o)
   (%get-address-info host
                      (if (integer? service) (number->string service) service)
-                     (make-address-info address-family/inet
-                                        socket-type/stream
-                                        ip-proto/tcp)))
+                     (if (and (pair? o) (car o))
+                         (car o)
+                         (make-address-info address-family/inet
+                                         socket-type/stream
+                                         ip-proto/tcp))))
 
 ;;> Opens a client net connection to @var{host}, a string,
 ;;> on port @var{service}, which can be a string such as
@@ -22,7 +24,7 @@
 ;;> or @scheme{#f} on failure.
 
 (define (open-net-io host service)
-  (let lp ((addr (get-address-info host service #f)))
+  (let lp ((addr (get-address-info host service)))
     (if (not addr)
         (error "couldn't find address" host service)
         (let ((sock (socket (address-info-family addr)