;;; Code:
(require 'url-vars)
+(require 'url-parse)
;; Fixme: support SSH explicitly or via a url-gateway-rlogin-program?
name buffer host service
:type gw-method
;; Use non-blocking socket if we can.
- :nowait (featurep 'make-network-process
- '(:nowait t))))
+ :nowait (and (featurep 'make-network-process)
+ (url-asynchronous url-current-object)
+ '(:nowait t))))
(`socks
(socks-open-network-stream name buffer host service))
(`telnet
target attributes fullness))
(:copier nil))
type user password host portspec filename target attributes fullness
- silent (use-cookies t))
+ silent (use-cookies t)
+ (asynchronous t))
(defsubst url-port (urlobj)
"Return the port number for the URL specified by URLOBJ.
(defvar url-retrieve-number-of-calls 0)
(autoload 'url-cache-prune-cache "url-cache")
+(defvar url-asynchronous t
+ "Bind to nil before calling `url-retrieve' to signal :nowait connections.")
;;;###autoload
(defun url-retrieve (url callback &optional cbargs silent inhibit-cookies)
(unless (url-type url)
(error "Bad url: %s" (url-recreate-url url)))
(setf (url-silent url) silent)
+ (setf (url-asynchronous url) url-asynchronous)
(setf (url-use-cookies url) (not inhibit-cookies))
;; Once in a while, remove old entries from the URL cache.
(when (zerop (% url-retrieve-number-of-calls 1000))
(let ((retrieval-done nil)
(start-time (current-time))
+ (url-asynchronous nil)
(asynch-buffer nil))
(setq asynch-buffer
(url-retrieve url (lambda (&rest ignored)