Function: url-http-content-length-after-change-function

url-http-content-length-after-change-function is a byte-compiled function defined in url-http.el.gz.

Signature

(url-http-content-length-after-change-function ST ND LENGTH)

Documentation

Function used when we DO know how long the document is going to be.

More sophisticated percentage downloaded, etc. Also does minimal parsing of HTTP headers and will actually cause the callback to be triggered.

Source Code

;; Defined in /usr/src/emacs/lisp/url/url-http.el.gz
(defun url-http-content-length-after-change-function (_st nd _length)
  "Function used when we DO know how long the document is going to be.
More sophisticated percentage downloaded, etc.
Also does minimal parsing of HTTP headers and will actually cause
the callback to be triggered."
  (if url-http-content-type
      (url-display-message
       "Reading [%s]... %s of %s (%d%%)"
       url-http-content-type
       (funcall byte-count-to-string-function (- nd url-http-end-of-headers))
       (funcall byte-count-to-string-function url-http-content-length)
       (url-percentage (- nd url-http-end-of-headers)
		       url-http-content-length))
    (url-display-message
     "Reading... %s of %s (%d%%)"
     (funcall byte-count-to-string-function (- nd url-http-end-of-headers))
     (funcall byte-count-to-string-function url-http-content-length)
     (url-percentage (- nd url-http-end-of-headers)
		     url-http-content-length)))

  (if (> (- nd url-http-end-of-headers) url-http-content-length)
      (progn
	;; Found the end of the document!  Wheee!
	(url-lazy-message "Reading... done.")
	(if (url-http-parse-headers)
	    (url-http-activate-callback)))))