1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-06 03:40:56 -08:00

(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.
This commit is contained in:
Chong Yidong 2007-02-04 00:20:59 +00:00
parent 05630abe3c
commit b3cd7f6176
2 changed files with 13 additions and 1 deletions

View file

@ -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)