[closure-cvs] CVS closure/src/net

dlichteblau dlichteblau at common-lisp.net
Tue Jan 2 13:13:03 UTC 2007


Update of /project/closure/cvsroot/closure/src/net
In directory clnet:/tmp/cvs-serv24908/src/net

Modified Files:
	ftp.lisp http.lisp 
Log Message:

Removed open-inet-socket from dep-*.

Move g/open-inet-socket from glisp into net/.
[Its :char case was never being used, all implementations used :byte.]

Depend on trivial-sockets to create the socket.  Usocket seems to be
better maintained, but has trivial-sockets compatibility and our socket
needs are "trivial" right now.


--- /project/closure/cvsroot/closure/src/net/ftp.lisp	2006/12/31 15:42:41	1.3
+++ /project/closure/cvsroot/closure/src/net/ftp.lisp	2007/01/02 13:13:03	1.4
@@ -254,6 +254,10 @@
             (setf message (concatenate 'string message (string #\newline) line))))
         (values response-code message)))))
      
+(defun g/open-inet-socket (host port)
+  (cl-byte-stream->gstream
+   (trivial-sockets:open-stream host port :element-type '(unsigned-byte 8))))
+
 (defmethod ftp/initiate-connection ((self ftp-connection))
   (with-slots (io host port) self
     (setf io (g/open-inet-socket host port))
--- /project/closure/cvsroot/closure/src/net/http.lisp	2006/12/31 15:42:41	1.10
+++ /project/closure/cvsroot/closure/src/net/http.lisp	2007/01/02 13:13:03	1.11
@@ -310,22 +310,24 @@
   ;; -> io proxyp
   (let* ((host (or (url:url-host url) "localhost"))
          (https-p (string= (url:url-protocol url) "https"))
+	 ;; ### HTTPS support doesn't exist
          (port (or (url:url-port url)
                    (if https-p
                        443
-                     80)))
-         (opener (if https-p
-                     #'glisp::g/open-inet-socket-ssl
-                   #'g/open-inet-socket))
+		       80)))
          (proxyp (and *use-http-proxy-p*
                       (= port 80)
                       (not (url:url-port url))
                       (not (string-equal host "localhost")))))
     (values
-     (cond (proxyp
-            (funcall opener *http-proxy-host* *http-proxy-port*))
-           (t
-            (funcall opener host port)))
+     (cl-byte-stream->gstream
+      (if proxyp
+	  (trivial-sockets:open-stream *http-proxy-host*
+				       *http-proxy-port*
+				       :element-type '(unsigned-byte 8))
+	  (trivial-sockets:open-stream host
+				       port
+				       :element-type '(unsigned-byte 8))))
      proxyp)))
 
 (defun http-make-request (method url header post-data)




More information about the Closure-cvs mailing list