From: Chong Yidong Date: Sun, 4 Feb 2007 00:20:59 +0000 (+0000) Subject: (url-http-connection-opened): New variable. X-Git-Tag: emacs-pretest-22.0.94~402 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b3cd7f617609bad8210c2e7e03486c307a8104c6;p=emacs.git (url-http-connection-opened): New variable. (url-http): Initialize it. (url-http-async-sentinel): Don't try changing sentinels. Run url-http-end-of-document-sentinel if necessary. --- diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index 0125d4b0bfa..96529b92385 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog @@ -1,3 +1,10 @@ +2007-02-04 Chong Yidong + + * url-http.el (url-http-connection-opened): New variable. + (url-http): Initialize it. + (url-http-async-sentinel): Don't try changing sentinels. + Run url-http-end-of-document-sentinel if necessary. + 2007-01-29 Juanma Barranquero * url-auth.el (url-get-authentication): Fix typo in docstring. diff --git a/lisp/url/url-http.el b/lisp/url/url-http.el index eb193f1c7a6..1d4d64f0e4d 100644 --- a/lisp/url/url-http.el +++ b/lisp/url/url-http.el @@ -30,6 +30,7 @@ (defvar url-http-extra-headers) (defvar url-http-target-url) (defvar url-http-proxy) +(defvar url-http-connection-opened) (require 'url-gw) (require 'url-util) (require 'url-parse) @@ -1118,6 +1119,7 @@ CBARGS as the arguments." url-http-extra-headers url-http-data url-http-target-url + url-http-connection-opened url-http-proxy)) (set (make-local-variable var) nil)) @@ -1132,6 +1134,7 @@ CBARGS as the arguments." url-callback-arguments cbargs url-http-after-change-function 'url-http-wait-for-headers-change-function url-http-target-url url-current-object + url-http-connection-opened nil url-http-proxy url-using-proxy) (set-process-buffer connection buffer) @@ -1155,8 +1158,10 @@ CBARGS as the arguments." ;; has occurred. (with-current-buffer (process-buffer proc) (cond + (url-http-connection-opened + (url-http-end-of-document-sentinel proc why)) ((string= (substring why 0 4) "open") - (set-process-sentinel proc 'url-http-end-of-document-sentinel) + (setq url-http-connection-opened t) (process-send-string proc (url-http-create-request))) (t (setf (car url-callback-arguments)