Function: url-http-async-sentinel

url-http-async-sentinel is a byte-compiled function defined in url-http.el.gz.

Signature

(url-http-async-sentinel PROC WHY)

Source Code

;; Defined in /usr/src/emacs/lisp/url/url-http.el.gz
(defun url-http-async-sentinel (proc why)
  ;; We are performing an asynchronous connection, and a status change
  ;; has occurred.
  (when (buffer-name (process-buffer proc))
    (with-current-buffer (process-buffer proc)
      (cond
       (url-http-connection-opened
	(setq url-http-no-retry t)
	(url-http-end-of-document-sentinel proc why))
       ((string= (substring why 0 4) "open")
	(setq url-http-connection-opened t)
        (if (and url-http-proxy (string= "https" (url-type url-current-object)))
            (url-https-proxy-connect proc)
          (condition-case error
              (process-send-string proc (url-http-create-request))
            (file-error
             (setq url-http-connection-opened nil)
             (message "HTTP error: %s" error)))))
       (t
	(setf (car url-callback-arguments)
	      (nconc (list :error (list 'error 'connection-failed why
					:host (url-host (or url-http-proxy url-current-object))
					:service (url-port (or url-http-proxy url-current-object))))
		     (car url-callback-arguments)))
	(url-http-activate-callback))))))