diff lisp/url/url-gw.el @ 73501:437fb645afb4

* url-http.el (url-http-mark-connection-as-free): Verify that connection is open before saving it. (url-http-handle-authentication): Use url-retrieve-internal instead of url-retrieve. (url-http-parse-headers): Adapt to new callback interface. (url-http): Handle non-blocking connections. (url-http-async-sentinel): Create. * url.el (url-retrieve): Update docstring for new callback interface. Remove all code. (url-retrieve-internal): Move code from url-retrieve here. * url-gw.el (url-open-stream): Use a non-blocking socket for `native' gateway method, if available.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 27 Oct 2006 14:44:25 +0000
parents 07c1b5999e53
children 61352a6a6dcf 034f67f59091
line wrap: on
line diff
--- a/lisp/url/url-gw.el	Fri Oct 27 14:39:43 2006 +0000
+++ b/lisp/url/url-gw.el	Fri Oct 27 14:44:25 2006 +0000
@@ -210,7 +210,8 @@
 (defun url-open-stream (name buffer host service)
   "Open a stream to HOST, possibly via a gateway.
 Args per `open-network-stream'.
-Will not make a connection if `url-gateway-unplugged' is non-nil."
+Will not make a connection if `url-gateway-unplugged' is non-nil.
+Might do a non-blocking connection; use `process-status' to check."
   (unless url-gateway-unplugged
     (let ((gw-method (if (and url-gateway-local-host-regexp
 			      (not (eq 'tls url-gateway-method))
@@ -249,7 +250,11 @@
 			 (ssl
 			  (open-ssl-stream name buffer host service))
 			 ((native)
-			  (open-network-stream name buffer host service))
+			  ;; Use non-blocking socket if we can.
+			  (make-network-process :name name :buffer buffer
+						:host host :service service
+						:nowait 
+						(and nil (featurep 'make-network-process '(:nowait t)))))
 			 (socks
 			  (socks-open-network-stream name buffer host service))
 			 (telnet