GNU bug report logs - #10478
24.0.50; url-http-parse-headers can silently drop the response when handling BASIC AUTHENTICATION

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Jerry Asher <jerry.asher@HIDDEN>; Keywords: confirmed; dated Wed, 11 Jan 2012 07:11:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 10478 <at> debbugs.gnu.org:


Received: (at 10478) by debbugs.gnu.org; 25 Dec 2015 21:49:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 25 16:49:29 2015
Received: from localhost ([127.0.0.1]:35617 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aCaEr-0004QN-1X
	for submit <at> debbugs.gnu.org; Fri, 25 Dec 2015 16:49:29 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:57719)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <larsi@HIDDEN>) id 1aCaEp-0004QG-SP
 for 10478 <at> debbugs.gnu.org; Fri, 25 Dec 2015 16:49:28 -0500
Received: from 2.150.58.24.tmi.telenormobil.no ([2.150.58.24] helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from <larsi@HIDDEN>)
 id 1aCaEU-0004xW-H5; Fri, 25 Dec 2015 22:49:06 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Jerry Asher <jerry.asher@HIDDEN>
Subject: Re: bug#10478: 24.0.50;
 url-http-parse-headers can silently drop the response when handling
 BASIC AUTHENTICATION
References: <CAEtC88V2G5j9dApZW3x8qrs0ecxLGP65PicaruN3pe-kjOiiBQ@HIDDEN>
Date: Fri, 25 Dec 2015 22:49:05 +0100
In-Reply-To: <CAEtC88V2G5j9dApZW3x8qrs0ecxLGP65PicaruN3pe-kjOiiBQ@HIDDEN>
 (Jerry Asher's message of "Wed, 11 Jan 2012 00:03:06 -0700")
Message-ID: <8737uqyzam.fsf@HIDDEN>
User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1aCaEU-0004xW-H5
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1451684946.72154@kmMvqhqenpSgJw6lemulcg
X-Spam-Status: No
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 10478
Cc: 10478 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.7 (/)

Jerry Asher <jerry.asher@HIDDEN> writes:

> When making a GET request again their simplest api, users/me that
> returns information about the logged in user, url-retrieve-synchronously
> will return the wrong buffer.
>
> This seems to be traceable to url-http-parse-headers handling the "401
> Basic: Access denied message by" calling url-http-handle-authentication
> which prompts the user for a name and password and calls
> url-retrieve-internal to retry the request.

I can confirm that this bug is still present in Emacs 25.  It returns
the buffer with the 401 message, not the buffer with the response...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10478; Package emacs. Full text available.

Message received at 10478 <at> debbugs.gnu.org:


Received: (at 10478) by debbugs.gnu.org; 11 Jan 2012 09:42:53 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 11 04:42:53 2012
Received: from localhost ([127.0.0.1]:53321 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Rkuhn-0008QQ-Ve
	for submit <at> debbugs.gnu.org; Wed, 11 Jan 2012 04:42:52 -0500
Received: from mailout-de.gmx.net ([213.165.64.23]:34178)
	by debbugs.gnu.org with smtp (Exim 4.72)
	(envelope-from <michael.albinus@HIDDEN>) id 1Rkuhk-0008QH-CI
	for 10478 <at> debbugs.gnu.org; Wed, 11 Jan 2012 04:42:49 -0500
Received: (qmail invoked by alias); 11 Jan 2012 09:42:22 -0000
Received: from p57BB9657.dip0.t-ipconnect.de (EHLO detlef.gmx.de)
	[87.187.150.87]
	by mail.gmx.net (mp059) with SMTP; 11 Jan 2012 10:42:22 +0100
X-Authenticated: #3708877
X-Provags-ID: V01U2FsdGVkX1+yn3d29fWyC7yazoswCVfhkGeXjJRK0oJIM9ZoJ8
	K7sJaeQ6TwEEyZ
From: Michael Albinus <michael.albinus@HIDDEN>
To: Jerry Asher <jerry.asher@HIDDEN>
Subject: Re: bug#10478: Possible fix??
References: <CAEtC88V2G5j9dApZW3x8qrs0ecxLGP65PicaruN3pe-kjOiiBQ@HIDDEN>
	<CAEtC88Vh1K7gr_AGFmn-NJoCj=Hhqgbc3PrQmJck99MdryXsRA@HIDDEN>
Date: Wed, 11 Jan 2012 10:42:07 +0100
In-Reply-To: <CAEtC88Vh1K7gr_AGFmn-NJoCj=Hhqgbc3PrQmJck99MdryXsRA@HIDDEN>
	(Jerry Asher's message of "Wed, 11 Jan 2012 00:54:15 -0700")
Message-ID: <8762gi7ez4.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Y-GMX-Trusted: 0
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 10478
Cc: 10478 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.9 (-)

Jerry Asher <jerry.asher@HIDDEN> writes:

Hi,

> The following, ugly, changes in url-http.el seem to work, based on
> very very very limited testing....
>
> Basically,
>
> I changed url-http-handle-authentication so that if a change of buffer
> was made, it would return the new buffer, otherwise it would return
> nil.
>
> Then in=C2=A0 url-http-parse-headers,=C2=A0I=C2=A0cut and pasted code for=
 the 3XX
> redirect case that sets a flag for url-retrieve-synchronously to do
> the same thing for the =C2=A0401 and 407 cases.

Maybe there is a simple solution, using `save-current-buffer'?

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10478; Package emacs. Full text available.

Message received at 10478 <at> debbugs.gnu.org:


Received: (at 10478) by debbugs.gnu.org; 11 Jan 2012 07:55:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 11 02:55:09 2012
Received: from localhost ([127.0.0.1]:53170 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Rkt1V-0005Bj-Ef
	for submit <at> debbugs.gnu.org; Wed, 11 Jan 2012 02:55:09 -0500
Received: from mail-iy0-f172.google.com ([209.85.210.172]:56121)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <jerry.asher@HIDDEN>) id 1Rkt1R-0005BI-AF
	for 10478 <at> debbugs.gnu.org; Wed, 11 Jan 2012 02:55:04 -0500
Received: by iaae16 with SMTP id e16so314149iaa.3
	for <10478 <at> debbugs.gnu.org>; Tue, 10 Jan 2012 23:54:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	bh=5hSJDT1pCtn7zDdpnCpJH5XZf3lODL0G9ZXI65aScAU=;
	b=u1YYRPA3PSB6RiW0VMSLPH27uawZHWO5h65GHaLiOXZ5gyLeSXuBpsUobHOR6Bf7I9
	f+JBAyXNGh/UDWykuI1wpoXpXZ5TxLTE1XS4cR5CzewfNKaaOpAVdwLF68EtHlstofIU
	JS2xjrYL2/XG7o3yjRBlMsCQVPaFCg8gJarAI=
Received: by 10.50.45.195 with SMTP id p3mr5459567igm.2.1326268476507; Tue, 10
	Jan 2012 23:54:36 -0800 (PST)
MIME-Version: 1.0
Received: by 10.42.218.74 with HTTP; Tue, 10 Jan 2012 23:54:15 -0800 (PST)
From: Jerry Asher <jerry.asher@HIDDEN>
Date: Wed, 11 Jan 2012 00:54:15 -0700
Message-ID: <CAEtC88Vh1K7gr_AGFmn-NJoCj=Hhqgbc3PrQmJck99MdryXsRA@HIDDEN>
Subject: Possible fix??
To: 10478 <at> debbugs.gnu.org
Content-Type: multipart/alternative; boundary=14dae934061b6b464204b63bf1f8
X-Debbugs-Envelope-To: 10478
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org

--14dae934061b6b464204b63bf1f8
Content-Type: text/plain; charset=ISO-8859-1

The following, ugly, changes in url-http.el seem to work, based on very
very very limited testing....

Basically,

I changed url-http-handle-authentication so that if a change of buffer was
made, it would return the new buffer, otherwise it would return nil.

Then in  url-http-parse-headers, I cut and pasted code for the 3XX redirect
case that sets a flag for url-retrieve-synchronously to do the same thing
for the  401 and 407 cases.

I apologize, instead of sending patches, I am just going to attach the two
new functions.

(defun url-http-handle-authentication (proxy)
  (declare (special status success url-http-method url-http-data
    url-callback-function url-callback-arguments))
  (url-http-debug "Handling %s authentication" (if proxy "proxy" "normal"))
  (let ((auths (or (nreverse
    (mail-fetch-field
     (if proxy "proxy-authenticate" "www-authenticate")
     nil nil t))
  '("basic")))
 (type nil)
(url (url-recreate-url url-current-object))
 (auth-url (url-recreate-url
   (if (and proxy (boundp 'url-http-proxy))
       url-http-proxy
     url-current-object)))
 (url-basic-auth-storage (if proxy
    ;; Cheating, but who cares? :)
    'url-http-proxy-basic-auth-storage
  'url-http-real-basic-auth-storage))
 auth
(strength 0)
        (retval nil))

    ;; find strongest supported auth
    (dolist (this-auth auths)
      (setq this-auth (url-eat-trailing-space
       (url-strip-leading-spaces
 this-auth)))
      (let* ((this-type
      (if (string-match "[ \t]" this-auth)
  (downcase (substring this-auth 0 (match-beginning 0)))
 (downcase this-auth)))
     (registered (url-auth-registered this-type))
     (this-strength (cddr registered)))
(when (and registered (> this-strength strength))
  (setq auth this-auth
type this-type
 strength this-strength))))

    (if (not (url-auth-registered type))
(progn
  (widen)
  (goto-char (point-max))
  (insert "<hr>Sorry, but I do not know how to handle " type
  " authentication.  If you'd like to write it,"
  " send it to " url-bug-address ".<hr>")
  (setq status t)
          (setq retval nil))
      (let* ((args (url-parse-args (subst-char-in-string ?, ?\; auth)))
     (auth (url-get-authentication auth-url
   (cdr-safe (assoc "realm" args))
   type t args)))
(if (not auth)
            (progn
              (setq success t)
              (set retval nil))
  (push (cons (if proxy "Proxy-Authorization" "Authorization") auth)
url-http-extra-headers)
  (let ((url-request-method url-http-method)
(url-request-data url-http-data)
 (url-request-extra-headers url-http-extra-headers)
                (response-buffer nil))
    (setq response-buffer
                  (url-retrieve-internal url url-callback-function
                                         url-callback-arguments))
            (url-http-debug "Handling authentication return buffer is %s"
response-buffer)
            (setq retval response-buffer)))))
    (url-http-debug "Handling authentication retval is %s 2:" retval)
    retval))


and

;; GET HERE
(defun url-http-parse-headers ()
 "Parse and handle HTTP specific headers.
Return t if and only if the current buffer is still active and
should be shown to the user."
  ;; The comments after each status code handled are taken from RFC
  ;; 2616 (HTTP/1.1)
  (declare (special url-http-end-of-headers url-http-response-status
    url-http-response-version
    url-http-method url-http-data url-http-process
    url-callback-function url-callback-arguments))

  (url-http-mark-connection-as-free (url-host url-current-object)
    (url-port url-current-object)
    url-http-process)

  (if (or (not (boundp 'url-http-end-of-headers))
  (not url-http-end-of-headers))
      (error "Trying to parse headers in odd buffer: %s" (buffer-name)))
  (goto-char (point-min))
  (url-http-debug "url-http-parse-headers called in (%s)" (buffer-name))
  (url-http-parse-response)
  (mail-narrow-to-head)
  ;;(narrow-to-region (point-min) url-http-end-of-headers)
  (let ((connection (mail-fetch-field "Connection")))
    ;; In HTTP 1.0, keep the connection only if there is a
    ;; "Connection: keep-alive" header.
    ;; In HTTP 1.1 (and greater), keep the connection unless there is a
    ;; "Connection: close" header
    (cond
     ((string= url-http-response-version "1.0")
      (unless (and connection
   (string= (downcase connection) "keep-alive"))
(delete-process url-http-process)))
     (t
      (when (and connection
 (string= (downcase connection) "close"))
 (delete-process url-http-process)))))
  (let ((buffer (current-buffer))
 (class nil)
(success nil)
 ;; other status symbols: jewelry and luxury cars
(status-symbol (cadr (assq url-http-response-status url-http-codes)))
 ;; The filename part of a URL could be in remote file syntax,
;; see Bug#6717 for an example.  We disable file name
 ;; handlers, therefore.
(file-name-handler-alist nil))
    (setq class (/ url-http-response-status 100))
    (url-http-debug "Parsed HTTP headers: class=%d status=%d" class
url-http-response-status)
    (url-http-handle-cookies)

    (case class
      ;; Classes of response codes
      ;;
      ;; 5xx = Server Error
      ;; 4xx = Client Error
      ;; 3xx = Redirection
      ;; 2xx = Successful
      ;; 1xx = Informational
      (1 ; Information messages
       ;; 100 = Continue with request
       ;; 101 = Switching protocols
       ;; 102 = Processing (Added by DAV)
       (url-mark-buffer-as-dead buffer)
       (error "HTTP responses in class 1xx not supported (%d)"
url-http-response-status))
      (2 ; Success
       ;; 200 Ok
       ;; 201 Created
       ;; 202 Accepted
       ;; 203 Non-authoritative information
       ;; 204 No content
       ;; 205 Reset content
       ;; 206 Partial content
       ;; 207 Multi-status (Added by DAV)
       (case status-symbol
 ((no-content reset-content)
  ;; No new data, just stay at the same document
  (url-mark-buffer-as-dead buffer)
  (setq success t))
 (otherwise
  ;; Generic success for all others.  Store in the cache, and
  ;; mark it as successful.
  (widen)
  (if (and url-automatic-caching (equal url-http-method "GET"))
      (url-store-in-cache buffer))
  (setq success t))))
      (3 ; Redirection
       ;; 300 Multiple choices
       ;; 301 Moved permanently
       ;; 302 Found
       ;; 303 See other
       ;; 304 Not modified
       ;; 305 Use proxy
       ;; 307 Temporary redirect
       (let ((redirect-uri (or (mail-fetch-field "Location")
       (mail-fetch-field "URI"))))
 (case status-symbol
   (multiple-choices    ; 300
    ;; Quoth the spec (section 10.3.1)
    ;; -------------------------------
    ;; The requested resource corresponds to any one of a set of
    ;; representations, each with its own specific location and
    ;; agent-driven negotiation information is being provided so
    ;; that the user can select a preferred representation and
    ;; redirect its request to that location.
    ;; [...]
    ;; If the server has a preferred choice of representation, it
    ;; SHOULD include the specific URI for that representation in
    ;; the Location field; user agents MAY use the Location field
    ;; value for automatic redirection.
    ;; -------------------------------
    ;; We do not support agent-driven negotiation, so we just
    ;; redirect to the preferred URI if one is provided.
    nil)
   ((moved-permanently found temporary-redirect) ; 301 302 307
    ;; If the 301|302 status code is received in response to a
    ;; request other than GET or HEAD, the user agent MUST NOT
    ;; automatically redirect the request unless it can be
    ;; confirmed by the user, since this might change the
    ;; conditions under which the request was issued.
    (unless (member url-http-method '("HEAD" "GET"))
      (setq redirect-uri nil)))
   (see-other ; 303
    ;; The response to the request can be found under a different
    ;; URI and SHOULD be retrieved using a GET method on that
    ;; resource.
    (setq url-http-method "GET"
  url-http-data nil))
   (not-modified ; 304
    ;; The 304 response MUST NOT contain a message-body.
    (url-http-debug "Extracting document from cache... (%s)"
    (url-cache-create-filename (url-view-url t)))
    (url-cache-extract (url-cache-create-filename (url-view-url t)))
    (setq redirect-uri nil
  success t))
   (use-proxy ; 305
    ;; The requested resource MUST be accessed through the
    ;; proxy given by the Location field.  The Location field
    ;; gives the URI of the proxy.  The recipient is expected
    ;; to repeat this single request via the proxy.  305
    ;; responses MUST only be generated by origin servers.
    (error "Redirection thru a proxy server not supported: %s"
   redirect-uri))
   (otherwise
    ;; Treat everything like '300'
    nil))
 (when redirect-uri
   ;; Clean off any whitespace and/or <...> cruft.
   (if (string-match "\\([^ \t]+\\)[ \t]" redirect-uri)
       (setq redirect-uri (match-string 1 redirect-uri)))
   (if (string-match "^<\\(.*\\)>$" redirect-uri)
       (setq redirect-uri (match-string 1 redirect-uri)))

   ;; Some stupid sites (like sourceforge) send a
   ;; non-fully-qualified URL (ie: /), which royally confuses
   ;; the URL library.
   (if (not (string-match url-nonrelative-link redirect-uri))
               ;; Be careful to use the real target URL, otherwise we may
               ;; compute the redirection relative to the URL of the proxy.
       (setq redirect-uri
     (url-expand-file-name redirect-uri url-http-target-url)))
           (let ((url-request-method url-http-method)
 (url-request-data url-http-data)
 (url-request-extra-headers url-http-extra-headers))
     ;; Check existing number of redirects
     (if (or (< url-max-redirections 0)
     (and (> url-max-redirections 0)
  (let ((events (car url-callback-arguments))
 (old-redirects 0))
    (while events
      (if (eq (car events) :redirect)
  (setq old-redirects (1+ old-redirects)))
      (and (setq events (cdr events))
   (setq events (cdr events))))
    (< old-redirects url-max-redirections))))
 ;; url-max-redirections hasn't been reached, so go
 ;; ahead and redirect.
 (progn
   ;; Remember that the request was redirected.
   (setf (car url-callback-arguments)
 (nconc (list :redirect redirect-uri)
(car url-callback-arguments)))
   ;; Put in the current buffer a forwarding pointer to the new
   ;; destination buffer.
   ;; FIXME: This is a hack to fix url-retrieve-synchronously
   ;; without changing the API.  Instead url-retrieve should
   ;; either simply not return the "destination" buffer, or it
   ;; should take an optional `dest-buf' argument.
   (set (make-local-variable 'url-redirect-buffer)
(url-retrieve-internal
 redirect-uri url-callback-function
 url-callback-arguments
 (url-silent url-current-object)))
   (url-mark-buffer-as-dead buffer))
       ;; We hit url-max-redirections, so issue an error and
       ;; stop redirecting.
       (url-http-debug "Maximum redirections reached")
       (setf (car url-callback-arguments)
     (nconc (list :error (list 'error 'http-redirect-limit
       redirect-uri))
    (car url-callback-arguments)))
       (setq success t))))))
      (4 ; Client error
       ;; 400 Bad Request
       ;; 401 Unauthorized
       ;; 402 Payment required
       ;; 403 Forbidden
       ;; 404 Not found
       ;; 405 Method not allowed
       ;; 406 Not acceptable
       ;; 407 Proxy authentication required
       ;; 408 Request time-out
       ;; 409 Conflict
       ;; 410 Gone
       ;; 411 Length required
       ;; 412 Precondition failed
       ;; 413 Request entity too large
       ;; 414 Request-URI too large
       ;; 415 Unsupported media type
       ;; 416 Requested range not satisfiable
       ;; 417 Expectation failed
       ;; 422 Unprocessable Entity (Added by DAV)
       ;; 423 Locked
       ;; 424 Failed Dependency
       (case status-symbol
 (unauthorized ; 401
  ;; The request requires user authentication.  The response
  ;; MUST include a WWW-Authenticate header field containing a
  ;; challenge applicable to the requested resource.  The
  ;; client MAY repeat the request with a suitable
  ;; Authorization header field.

          ;; bug patch because url-http-handle-authentication
          ;; might return a new buffer

          (let ((retval (url-http-handle-authentication nil)))
            (url-http-debug "Url Http Parse Headers: handling
authentication return buffer TO %s" retval)
            (when retval
              ;; Put in the current buffer a forwarding pointer to the new
              ;; destination buffer.
              ;; FIXME: This is a hack to fix url-retrieve-synchronously
              ;; without changing the API.  Instead url-retrieve should
              ;; either simply not return the "destination" buffer, or it
              ;; should take an optional `dest-buf' argument.
              (set (make-local-variable 'url-redirect-buffer)
                   retval)
              (url-http-debug "Url Http Parse Headers: handling
authentication return buffer TO %s -> %s 2:"
                              retval url-redirect-buffer)
              (url-mark-buffer-as-dead buffer))))

 (payment-required              ; 402
  ;; This code is reserved for future use
  (url-mark-buffer-as-dead buffer)
  (error "Somebody wants you to give them money"))
 (forbidden ; 403
  ;; The server understood the request, but is refusing to
  ;; fulfill it.  Authorization will not help and the request
  ;; SHOULD NOT be repeated.
  (setq success t))
 (not-found ; 404
  ;; Not found
  (setq success t))
 (method-not-allowed ; 405
  ;; The method specified in the Request-Line is not allowed
  ;; for the resource identified by the Request-URI.  The
  ;; response MUST include an Allow header containing a list of
  ;; valid methods for the requested resource.
  (setq success t))
 (not-acceptable ; 406
  ;; The resource identified by the request is only capable of
  ;; generating response entities which have content
  ;; characteristics nota cceptable according to the accept
  ;; headers sent in the request.
  (setq success t))
 (proxy-authentication-required ; 407
  ;; This code is similar to 401 (Unauthorized), but indicates
  ;; that the client must first authenticate itself with the
  ;; proxy.  The proxy MUST return a Proxy-Authenticate header
  ;; field containing a challenge applicable to the proxy for
  ;; the requested resource.

          ;; bug patch because url-http-handle-authentication
          ;; might return a new buffer

          (let ((retval (url-http-handle-authentication t)))

            (when retval
            ;; Put in the current buffer a forwarding pointer to the new
   ;; destination buffer.
   ;; FIXME: This is a hack to fix url-retrieve-synchronously
   ;; without changing the API.  Instead url-retrieve should
   ;; either simply not return the "destination" buffer, or it
   ;; should take an optional `dest-buf' argument.
   (set (make-local-variable 'url-redirect-buffer)
                        retval)
   (url-mark-buffer-as-dead buffer))))

 (request-timeout ; 408
  ;; The client did not produce a request within the time that
  ;; the server was prepared to wait.  The client MAY repeat
  ;; the request without modifications at any later time.
  (setq success t))
 (conflict ; 409
  ;; The request could not be completed due to a conflict with
  ;; the current state of the resource.  This code is only
  ;; allowed in situations where it is expected that the user
  ;; mioght be able to resolve the conflict and resubmit the
  ;; request.  The response body SHOULD include enough
  ;; information for the user to recognize the source of the
  ;; conflict.
  (setq success t))
 (gone                          ; 410
  ;; The requested resource is no longer available at the
  ;; server and no forwarding address is known.
  (setq success t))
 (length-required ; 411
  ;; The server refuses to accept the request without a defined
  ;; Content-Length.  The client MAY repeat the request if it
  ;; adds a valid Content-Length header field containing the
  ;; length of the message-body in the request message.
  ;;
  ;; NOTE - this will never happen because
  ;; `url-http-create-request' automatically calculates the
  ;; content-length.
  (setq success t))
 (precondition-failed ; 412
  ;; The precondition given in one or more of the
  ;; request-header fields evaluated to false when it was
  ;; tested on the server.
  (setq success t))
 ((request-entity-too-large request-uri-too-large) ; 413 414
  ;; The server is refusing to process a request because the
  ;; request entity|URI is larger than the server is willing or
  ;; able to process.
  (setq success t))
 (unsupported-media-type ; 415
  ;; The server is refusing to service the request because the
  ;; entity of the request is in a format not supported by the
  ;; requested resource for the requested method.
  (setq success t))
 (requested-range-not-satisfiable ; 416
  ;; A server SHOULD return a response with this status code if
  ;; a request included a Range request-header field, and none
  ;; of the range-specifier values in this field overlap the
  ;; current extent of the selected resource, and the request
  ;; did not include an If-Range request-header field.
  (setq success t))
 (expectation-failed ; 417
  ;; The expectation given in an Expect request-header field
  ;; could not be met by this server, or, if the server is a
  ;; proxy, the server has unambiguous evidence that the
  ;; request could not be met by the next-hop server.
  (setq success t))
 (otherwise
  ;; The request could not be understood by the server due to
  ;; malformed syntax.  The client SHOULD NOT repeat the
  ;; request without modifications.
  (setq success t)))
       ;; Tell the callback that an error occurred, and what the
       ;; status code was.
       (when success
 (setf (car url-callback-arguments)
       (nconc (list :error (list 'error 'http url-http-response-status))
      (car url-callback-arguments)))))
      (5
       ;; 500 Internal server error
       ;; 501 Not implemented
       ;; 502 Bad gateway
       ;; 503 Service unavailable
       ;; 504 Gateway time-out
       ;; 505 HTTP version not supported
       ;; 507 Insufficient storage
       (setq success t)
       (case url-http-response-status
 (not-implemented ; 501
  ;; The server does not support the functionality required to
  ;; fulfill the request.
  nil)
 (bad-gateway ; 502
  ;; The server, while acting as a gateway or proxy, received
  ;; an invalid response from the upstream server it accessed
  ;; in attempting to fulfill the request.
  nil)
 (service-unavailable ; 503
  ;; The server is currently unable to handle the request due
  ;; to a temporary overloading or maintenance of the server.
  ;; The implication is that this is a temporary condition
  ;; which will be alleviated after some delay.  If known, the
  ;; length of the delay MAY be indicated in a Retry-After
  ;; header.  If no Retry-After is given, the client SHOULD
  ;; handle the response as it would for a 500 response.
  nil)
 (gateway-timeout ; 504
  ;; The server, while acting as a gateway or proxy, did not
  ;; receive a timely response from the upstream server
  ;; specified by the URI (e.g. HTTP, FTP, LDAP) or some other
  ;; auxiliary server (e.g. DNS) it needed to access in
  ;; attempting to complete the request.
  nil)
 (http-version-not-supported ; 505
  ;; The server does not support, or refuses to support, the
  ;; HTTP protocol version that was used in the request
  ;; message.
  nil)
 (insufficient-storage ; 507 (DAV)
  ;; The method could not be performed on the resource
  ;; because the server is unable to store the representation
  ;; needed to successfully complete the request.  This
  ;; condition is considered to be temporary.  If the request
  ;; which received this status code was the result of a user
  ;; action, the request MUST NOT be repeated until it is
  ;; requested by a separate user action.
  nil))
       ;; Tell the callback that an error occurred, and what the
       ;; status code was.
       (when success
 (setf (car url-callback-arguments)
       (nconc (list :error (list 'error 'http url-http-response-status))
      (car url-callback-arguments)))))
      (otherwise
       (error "Unknown class of HTTP response code: %d (%d)"
      class url-http-response-status)))
    (if (not success)
(url-mark-buffer-as-dead buffer))
    (url-http-debug "Finished parsing HTTP headers: %S" success)
    (widen)
    success))

--14dae934061b6b464204b63bf1f8
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

The following, ugly, changes in <font face=3D"&#39;courier new&#39;, monosp=
ace">url-http.el</font> seem to work, based on very very very limited testi=
ng....<br><br>Basically,<br><br>I changed<font face=3D"&#39;courier new&#39=
;, monospace"> url-http-handle-authentication</font> so that if a change of=
 buffer was made, it would return the new buffer, otherwise it would return=
 nil.<br>

<br>Then in=A0
<span style=3D"font-family:&#39;courier new&#39;,monospace">url-http-parse-=
headers,</span>=A0I=A0cut and pasted code for the 3XX redirect case that se=
ts a flag for url-retrieve-synchronously to do the same thing for the =A040=
1 and 407 cases.<div>

<br></div><div>I apologize, instead of sending patches, I am just going to =
attach the two new functions.</div><div><br></div><div><div><font face=3D"&=
#39;courier new&#39;, monospace">(defun url-http-handle-authentication (pro=
xy)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 (declare (special =
status success url-http-method url-http-data</font></div><div><font face=3D=
"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"=
white-space:pre">		</span> =A0 =A0url-callback-function url-callback-argume=
nts))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 (url-http-debug &q=
uot;Handling %s authentication&quot; (if proxy &quot;proxy&quot; &quot;norm=
al&quot;))</font></div><div><font face=3D"&#39;courier new&#39;, monospace"=
>=A0 (let ((auths (or (nreverse</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 =A0(mail-fetch-field</font=
></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"=
Apple-tab-span" style=3D"white-space:pre">		</span> =A0 =A0 (if proxy &quot=
;proxy-authenticate&quot; &quot;www-authenticate&quot;)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 =A0 nil nil t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">		</span> =A0&#39;(&quot;basic&quot;))=
)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>(type nil)</font></div><div><fon=
t face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">	</span>(url (url-recreate-url url-current-object=
))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>(auth-url (url-recreate-url</fon=
t></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D=
"Apple-tab-span" style=3D"white-space:pre">		</span> =A0 (if (and proxy (bo=
undp &#39;url-http-proxy))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 =A0 =A0 url-http-proxy</fo=
nt></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">		</span> =A0 =A0 url-current=
-object)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>(url-basic-auth-storage (if prox=
y</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span cl=
ass=3D"Apple-tab-span" style=3D"white-space:pre">				</span> =A0 =A0;; Chea=
ting, but who cares? :)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">				</span> =A0 =A0&#39;url-http-proxy-b=
asic-auth-storage</font></div><div><font face=3D"&#39;courier new&#39;, mon=
ospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">				</span=
> =A0&#39;url-http-real-basic-auth-storage))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>auth</font></div><div><font face=
=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=
=3D"white-space:pre">	</span>(strength 0)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 (retva=
l nil))</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><b=
r></font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0=
 ;; find strongest supported auth</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (dolist (this-=
auth auths)</font></div><div><font face=3D"&#39;courier new&#39;, monospace=
">=A0 =A0 =A0 (setq this-auth (url-eat-trailing-space</font></div><div><fon=
t face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" =
style=3D"white-space:pre">		</span> =A0 =A0 =A0 (url-strip-leading-spaces</=
font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span>this-auth)))</font></div><div>=
<font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (let* ((this-ty=
pe</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0(if (string-match &q=
uot;[ \t]&quot; this-auth)</font></div><div><font face=3D"&#39;courier new&=
#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
	</span> =A0(downcase (substring this-auth 0 (match-beginning 0)))</font></=
div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span>(downcase this-auth)))</font></=
div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"App=
le-tab-span" style=3D"white-space:pre">	</span> =A0 =A0 (registered (url-au=
th-registered this-type))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 (this-strength (cddr re=
gistered)))</font></div><div><font face=3D"&#39;courier new&#39;, monospace=
"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>(when (a=
nd registered (&gt; this-strength strength))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq auth this-auth</font><=
/div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Ap=
ple-tab-span" style=3D"white-space:pre">		</span>type this-type</font></div=
>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span>strength this-strength))))</fon=
t></div><div><font face=3D"&#39;courier new&#39;, monospace"><br></font></d=
iv>
<div>
<font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (if (not (url-auth-=
registered type))</font></div><div><font face=3D"&#39;courier new&#39;, mon=
ospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>(p=
rogn</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(widen)</font></div><div><fo=
nt face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">	</span> =A0(goto-char (point-max))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(insert &quot;&lt;hr&gt;Sorr=
y, but I do not know how to handle &quot; type</font></div><div><font face=
=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=
=3D"white-space:pre">		</span> =A0&quot; authentication. =A0If you&#39;d li=
ke to write it,&quot;</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0&quot; send it to &quot; ur=
l-bug-address &quot;.&lt;hr&gt;&quot;)</font></div><div><font face=3D"&#39;=
courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-=
space:pre">	</span> =A0(setq status t)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 (s=
etq retval nil))</font></div><div><font face=3D"&#39;courier new&#39;, mono=
space">=A0 =A0 =A0 (let* ((args (url-parse-args (subst-char-in-string ?, ?\=
; auth)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 (auth (url-get-authenti=
cation auth-url</font></div><div><font face=3D"&#39;courier new&#39;, monos=
pace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">					</span>=
 =A0 (cdr-safe (assoc &quot;realm&quot; args))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">					</span> =A0 type t args)))</font></=
div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"App=
le-tab-span" style=3D"white-space:pre">	</span>(if (not auth)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 (progn</font></div><div><font face=3D"&#39;courier new&#39;, monospace"=
>=A0 =A0 =A0 =A0 =A0 =A0 =A0 (setq success t)</font></div><div><font face=
=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =A0 =A0 (set retv=
al nil))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(push (cons (if proxy &quot;=
Proxy-Authorization&quot; &quot;Authorization&quot;) auth)</font></div><div=
><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-s=
pan" style=3D"white-space:pre">		</span>url-http-extra-headers)</font></div=
>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(let ((url-request-method ur=
l-http-method)</font></div><div><font face=3D"&#39;courier new&#39;, monosp=
ace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">		</span>(url=
-request-data url-http-data)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span>(url-request-extra-headers url-=
http-extra-headers)</font></div><div><font face=3D"&#39;courier new&#39;, m=
onospace">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (response-buffer nil))</font></di=
v>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0(setq response-buffer</f=
ont></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 (url-retrieve-internal url url-callback-function</f=
ont></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0url-callback=
-arguments))</font></div><div><font face=3D"&#39;courier new&#39;, monospac=
e">=A0 =A0 =A0 =A0 =A0 =A0 (url-http-debug &quot;Handling authentication re=
turn buffer is %s&quot; response-buffer)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 (setq retval response-buffer)))))</font></div><div><font face=3D"&#39;c=
ourier new&#39;, monospace">=A0 =A0 (url-http-debug &quot;Handling authenti=
cation retval is %s 2:&quot; retval)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 retval))</font=
></div></div><div><br></div><div><br></div><div>and</div><div><br></div><di=
v><div><font face=3D"&#39;courier new&#39;, monospace">;; GET HERE</font></=
div>

<div><font face=3D"&#39;courier new&#39;, monospace">(defun url-http-parse-=
headers ()</font></div><div><font face=3D"&#39;courier new&#39;, monospace"=
>=A0&quot;Parse and handle HTTP specific headers.</font></div><div><font fa=
ce=3D"&#39;courier new&#39;, monospace">Return t if and only if the current=
 buffer is still active and</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">should be shown to the=
 user.&quot;</font></div><div><font face=3D"&#39;courier new&#39;, monospac=
e">=A0 ;; The comments after each status code handled are taken from RFC</f=
ont></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 ;; 2616 (HTTP/1.1)=
</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 (decl=
are (special url-http-end-of-headers url-http-response-status</font></div><=
div>

<font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-sp=
an" style=3D"white-space:pre">		</span> =A0 =A0url-http-response-version</f=
ont></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">		</span> =A0 =A0url-http-met=
hod url-http-data url-http-process</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 =A0url-callback-function u=
rl-callback-arguments))</font></div><div><font face=3D"&#39;courier new&#39=
;, monospace"><br>

</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 (url-=
http-mark-connection-as-free (url-host url-current-object)</font></div><div=
><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-s=
pan" style=3D"white-space:pre">				</span> =A0 =A0(url-port url-current-obj=
ect)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">				</span> =A0 =A0url-http-process)</fo=
nt></div><div><font face=3D"&#39;courier new&#39;, monospace"><br></font></=
div><div>

<font face=3D"&#39;courier new&#39;, monospace">=A0 (if (or (not (boundp &#=
39;url-http-end-of-headers))</font></div><div><font face=3D"&#39;courier ne=
w&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
>	</span> =A0(not url-http-end-of-headers))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (error &qu=
ot;Trying to parse headers in odd buffer: %s&quot; (buffer-name)))</font></=
div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 (goto-char (po=
int-min))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 (url-http-debug &q=
uot;url-http-parse-headers called in (%s)&quot; (buffer-name))</font></div>=
<div><font face=3D"&#39;courier new&#39;, monospace">=A0 (url-http-parse-re=
sponse)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 (mail-narrow-to-he=
ad)</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 ;;=
(narrow-to-region (point-min) url-http-end-of-headers)</font></div><div><fo=
nt face=3D"&#39;courier new&#39;, monospace">=A0 (let ((connection (mail-fe=
tch-field &quot;Connection&quot;)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 ;; In HTTP 1.0=
, keep the connection only if there is a</font></div><div><font face=3D"&#3=
9;courier new&#39;, monospace">=A0 =A0 ;; &quot;Connection: keep-alive&quot=
; header.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 ;; In HTTP 1.1=
 (and greater), keep the connection unless there is a</font></div><div><fon=
t face=3D"&#39;courier new&#39;, monospace">=A0 =A0 ;; &quot;Connection: cl=
ose&quot; header</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (cond</font></=
div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0((strin=
g=3D url-http-response-version &quot;1.0&quot;)</font></div><div><font face=
=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (unless (and connection</=
font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 (string=3D (downcase conne=
ction) &quot;keep-alive&quot;))</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span>(delete-process url-http-process)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0(t</font></=
div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (when =
(and connection</font></div><div><font face=3D"&#39;courier new&#39;, monos=
pace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">		</span> (s=
tring=3D (downcase connection) &quot;close&quot;))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>(delete-process url-http-process=
)))))</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =
(let ((buffer (current-buffer))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>(class nil)</font></div><div><fo=
nt face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">	</span>(success nil)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>;; other status symbols: jewelry=
 and luxury cars</font></div><div><font face=3D"&#39;courier new&#39;, mono=
space"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>(st=
atus-symbol (cadr (assq url-http-response-status url-http-codes)))</font></=
div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>;; The filename part of a URL co=
uld be in remote file syntax,</font></div><div><font face=3D"&#39;courier n=
ew&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre=
">	</span>;; see Bug#6717 for an example. =A0We disable file name</font></d=
iv>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span>;; handlers, therefore.</font></=
div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"App=
le-tab-span" style=3D"white-space:pre">	</span>(file-name-handler-alist nil=
))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (setq class (/=
 url-http-response-status 100))</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace">=A0 =A0 (url-http-debug &quot;Parsed HTTP headers: cl=
ass=3D%d status=3D%d&quot; class url-http-response-status)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (url-http-hand=
le-cookies)</font></div><div><font face=3D"&#39;courier new&#39;, monospace=
"><br></font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0=
 =A0 (case class</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 ;; Classes=
 of response codes</font></div><div><font face=3D"&#39;courier new&#39;, mo=
nospace">=A0 =A0 =A0 ;;</font></div><div><font face=3D"&#39;courier new&#39=
;, monospace">=A0 =A0 =A0 ;; 5xx =3D Server Error</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 ;; 4xx =3D=
 Client Error</font></div><div><font face=3D"&#39;courier new&#39;, monospa=
ce">=A0 =A0 =A0 ;; 3xx =3D Redirection</font></div><div><font face=3D"&#39;=
courier new&#39;, monospace">=A0 =A0 =A0 ;; 2xx =3D Successful</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 ;; 1xx =3D=
 Informational</font></div><div><font face=3D"&#39;courier new&#39;, monosp=
ace">=A0 =A0 =A0 (1<span class=3D"Apple-tab-span" style=3D"white-space:pre"=
>				</span>; Information messages</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 100 =
=3D Continue with request</font></div><div><font face=3D"&#39;courier new&#=
39;, monospace">=A0 =A0 =A0 =A0;; 101 =3D Switching protocols</font></div><=
div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 102 =
=3D Processing (Added by DAV)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0(url-ma=
rk-buffer-as-dead buffer)</font></div><div><font face=3D"&#39;courier new&#=
39;, monospace">=A0 =A0 =A0 =A0(error &quot;HTTP responses in class 1xx not=
 supported (%d)&quot; url-http-response-status))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (2<span cl=
ass=3D"Apple-tab-span" style=3D"white-space:pre">				</span>; Success</font=
></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0=
;; 200 Ok</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 201 =
Created</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=
=A0 =A0 =A0 =A0;; 202 Accepted</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace">=A0 =A0 =A0 =A0;; 203 Non-authoritative information</f=
ont></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 204 =
No content</font></div><div><font face=3D"&#39;courier new&#39;, monospace"=
>=A0 =A0 =A0 =A0;; 205 Reset content</font></div><div><font face=3D"&#39;co=
urier new&#39;, monospace">=A0 =A0 =A0 =A0;; 206 Partial content</font></di=
v>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 207 =
Multi-status (Added by DAV)</font></div><div><font face=3D"&#39;courier new=
&#39;, monospace">=A0 =A0 =A0 =A0(case status-symbol</font></div><div><font=
 face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" s=
tyle=3D"white-space:pre">	</span> ((no-content reset-content)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; No new data, just stay at=
 the same document</font></div><div><font face=3D"&#39;courier new&#39;, mo=
nospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =
=A0(url-mark-buffer-as-dead buffer)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (otherwise</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; Generic success for all o=
thers. =A0Store in the cache, and</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span> =A0;; mark it as successful.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(widen)</font></div><div><fo=
nt face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">	</span> =A0(if (and url-automatic-caching (equa=
l url-http-method &quot;GET&quot;))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0(url-store-in-cache =
buffer))</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><=
span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0(setq s=
uccess t))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (3<span cl=
ass=3D"Apple-tab-span" style=3D"white-space:pre">				</span>; Redirection</=
font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0=
 =A0;; 300 Multiple choices</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 301 =
Moved permanently</font></div><div><font face=3D"&#39;courier new&#39;, mon=
ospace">=A0 =A0 =A0 =A0;; 302 Found</font></div><div><font face=3D"&#39;cou=
rier new&#39;, monospace">=A0 =A0 =A0 =A0;; 303 See other</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 304 =
Not modified</font></div><div><font face=3D"&#39;courier new&#39;, monospac=
e">=A0 =A0 =A0 =A0;; 305 Use proxy</font></div><div><font face=3D"&#39;cour=
ier new&#39;, monospace">=A0 =A0 =A0 =A0;; 307 Temporary redirect</font></d=
iv>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0(let ((=
redirect-uri (or (mail-fetch-field &quot;Location&quot;)</font></div><div><=
font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-spa=
n" style=3D"white-space:pre">			</span> =A0 =A0 =A0 (mail-fetch-field &quot=
;URI&quot;))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (case status-symbol</font></div=
><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-=
tab-span" style=3D"white-space:pre">	</span> =A0 (multiple-choices<span cla=
ss=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =A0; 300</font=
></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; Quoth the spec (secti=
on 10.3.1)</font></div><div><font face=3D"&#39;courier new&#39;, monospace"=
><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =A0;=
; -------------------------------</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; The requested resourc=
e corresponds to any one of a set of</font></div><div><font face=3D"&#39;co=
urier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-sp=
ace:pre">	</span> =A0 =A0;; representations, each with its own specific loc=
ation and</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; agent-driven negotiat=
ion information is being provided so</font></div><div><font face=3D"&#39;co=
urier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-sp=
ace:pre">	</span> =A0 =A0;; that the user can select a preferred representa=
tion and</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; redirect its request =
to that location.</font></div><div><font face=3D"&#39;courier new&#39;, mon=
ospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =
=A0 =A0;; [...]</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; If the server has a p=
referred choice of representation, it</font></div><div><font face=3D"&#39;c=
ourier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-s=
pace:pre">	</span> =A0 =A0;; SHOULD include the specific URI for that repre=
sentation in</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; the Location field; u=
ser agents MAY use the Location field</font></div><div><font face=3D"&#39;c=
ourier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-s=
pace:pre">	</span> =A0 =A0;; value for automatic redirection.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; ---------------------=
----------</font></div><div><font face=3D"&#39;courier new&#39;, monospace"=
><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =A0;=
; We do not support agent-driven negotiation, so we just</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; redirect to the prefe=
rred URI if one is provided.</font></div><div><font face=3D"&#39;courier ne=
w&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
>	</span> =A0 =A0nil)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 ((moved-permanently found t=
emporary-redirect) ; 301 302 307</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0 =A0;; If the 301|302 status code is received in response =
to a</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; request other than GE=
T or HEAD, the user agent MUST NOT</font></div><div><font face=3D"&#39;cour=
ier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre">	</span> =A0 =A0;; automatically redirect the request unless it can =
be</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; confirmed by the user=
, since this might change the</font></div><div><font face=3D"&#39;courier n=
ew&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre=
">	</span> =A0 =A0;; conditions under which the request was issued.</font><=
/div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0(unless (member url-http=
-method &#39;(&quot;HEAD&quot; &quot;GET&quot;))</font></div><div><font fac=
e=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=
=3D"white-space:pre">	</span> =A0 =A0 =A0(setq redirect-uri nil)))</font></=
div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 (see-other<span class=3D"Ap=
ple-tab-span" style=3D"white-space:pre">			</span>; 303</font></div><div><f=
ont face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span=
" style=3D"white-space:pre">	</span> =A0 =A0;; The response to the request =
can be found under a different</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; URI and SHOULD be ret=
rieved using a GET method on that</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span> =A0 =A0;; resource.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0(setq url-http-method &q=
uot;GET&quot;</font></div><div><font face=3D"&#39;courier new&#39;, monospa=
ce"><span class=3D"Apple-tab-span" style=3D"white-space:pre">		</span> =A0u=
rl-http-data nil))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 (not-modified<span class=3D=
"Apple-tab-span" style=3D"white-space:pre">		</span>; 304</font></div><div>=
<font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-sp=
an" style=3D"white-space:pre">	</span> =A0 =A0;; The 304 response MUST NOT =
contain a message-body.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0(url-http-debug &quot;Ex=
tracting document from cache... (%s)&quot;</font></div><div><font face=3D"&=
#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"wh=
ite-space:pre">			</span> =A0 =A0(url-cache-create-filename (url-view-url t=
)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0(url-cache-extract (url-=
cache-create-filename (url-view-url t)))</font></div><div><font face=3D"&#3=
9;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"whit=
e-space:pre">	</span> =A0 =A0(setq redirect-uri nil</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0success t))</font></div><di=
v><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-=
span" style=3D"white-space:pre">	</span> =A0 (use-proxy<span class=3D"Apple=
-tab-span" style=3D"white-space:pre">			</span>; 305</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; The requested resourc=
e MUST be accessed through the</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0 =A0;; proxy given by the Location field. =A0The Location fi=
eld</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; gives the URI of the =
proxy. =A0The recipient is expected</font></div><div><font face=3D"&#39;cou=
rier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">	</span> =A0 =A0;; to repeat this single request via the proxy. =A0=
305</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; responses MUST only b=
e generated by origin servers.</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0 =A0(error &quot;Redirection thru a proxy server not support=
ed: %s&quot;</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 redirect-uri))</font></div=
><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-=
tab-span" style=3D"white-space:pre">	</span> =A0 (otherwise</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0;; Treat everything like=
 &#39;300&#39;</font></div><div><font face=3D"&#39;courier new&#39;, monosp=
ace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =
=A0nil))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (when redirect-uri</font></div>=
<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 ;; Clean off any whitespace=
 and/or &lt;...&gt; cruft.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 (if (string-match &quot;\\(=
[^ \t]+\\)[ \t]&quot; redirect-uri)</font></div><div><font face=3D"&#39;cou=
rier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">	</span> =A0 =A0 =A0 (setq redirect-uri (match-string 1 redirect-ur=
i)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 (if (string-match &quot;^&l=
t;\\(.*\\)&gt;$&quot; redirect-uri)</font></div><div><font face=3D"&#39;cou=
rier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">	</span> =A0 =A0 =A0 (setq redirect-uri (match-string 1 redirect-ur=
i)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><br></font></div><div>=
<font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-sp=
an" style=3D"white-space:pre">	</span> =A0 ;; Some stupid sites (like sourc=
eforge) send a</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 ;; non-fully-qualified URL =
(ie: /), which royally confuses</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span> =A0 ;; the URL library.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 (if (not (string-match url-=
nonrelative-link redirect-uri))</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0;; Be careful to use t=
he real target URL, otherwise we may</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0;; compute the redirection relative to the URL of the proxy.</fo=
nt></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0 (setq re=
direct-uri</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 =A0 (url-expand-file-name =
redirect-uri url-http-target-url)))</font></div><div><font face=3D"&#39;cou=
rier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =A0(let ((url-request-method =
url-http-method)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> (url-request-data url-http-dat=
a)</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span c=
lass=3D"Apple-tab-span" style=3D"white-space:pre">		</span> (url-request-ex=
tra-headers url-http-extra-headers))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 ;; Check existing numbe=
r of redirects</font></div><div><font face=3D"&#39;courier new&#39;, monosp=
ace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =
=A0 (if (or (&lt; url-max-redirections 0)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 =A0 (and (&gt; url-max-red=
irections 0)</font></div><div><font face=3D"&#39;courier new&#39;, monospac=
e"><span class=3D"Apple-tab-span" style=3D"white-space:pre">			</span> =A0(=
let ((events (car url-callback-arguments))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">				</span>(old-redirects 0))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">			</span> =A0 =A0(while events</font>=
</div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span> =A0 =A0 =A0(if (eq (car event=
s) :redirect)</font></div><div><font face=3D"&#39;courier new&#39;, monospa=
ce"><span class=3D"Apple-tab-span" style=3D"white-space:pre">				</span> =
=A0(setq old-redirects (1+ old-redirects)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span> =A0 =A0 =A0(and (setq events =
(cdr events))</font></div><div><font face=3D"&#39;courier new&#39;, monospa=
ce"><span class=3D"Apple-tab-span" style=3D"white-space:pre">				</span> =
=A0 (setq events (cdr events))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span> =A0 =A0(&lt; old-redirects ur=
l-max-redirections))))</font></div><div><font face=3D"&#39;courier new&#39;=
, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">		</s=
pan> ;; url-max-redirections hasn&#39;t been reached, so go</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> ;; ahead and redirect.</font><=
/div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Ap=
ple-tab-span" style=3D"white-space:pre">		</span> (progn</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 ;; Remember that the reque=
st was redirected.</font></div><div><font face=3D"&#39;courier new&#39;, mo=
nospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">		</span>=
 =A0 (setf (car url-callback-arguments)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span> (nconc (list :redirect redire=
ct-uri)</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><s=
pan class=3D"Apple-tab-span" style=3D"white-space:pre">				</span>(car url-=
callback-arguments)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 ;; Put in the current buff=
er a forwarding pointer to the new</font></div><div><font face=3D"&#39;cour=
ier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre">		</span> =A0 ;; destination buffer.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 ;; FIXME: This is a hack t=
o fix url-retrieve-synchronously</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">		</span> =A0 ;; without changing the API. =A0Instead url-retrieve sho=
uld</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 ;; either simply not retur=
n the &quot;destination&quot; buffer, or it</font></div><div><font face=3D"=
&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"w=
hite-space:pre">		</span> =A0 ;; should take an optional `dest-buf&#39; arg=
ument.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 (set (make-local-variable =
&#39;url-redirect-buffer)</font></div><div><font face=3D"&#39;courier new&#=
39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">		=
	</span>(url-retrieve-internal</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span> redirect-uri url-callback-fun=
ction</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><spa=
n class=3D"Apple-tab-span" style=3D"white-space:pre">			</span> url-callbac=
k-arguments</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span> (url-silent url-current-objec=
t)))</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span=
 class=3D"Apple-tab-span" style=3D"white-space:pre">		</span> =A0 (url-mark=
-buffer-as-dead buffer))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0 ;; We hit url-max-r=
edirections, so issue an error and</font></div><div><font face=3D"&#39;cour=
ier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre">	</span> =A0 =A0 =A0 ;; stop redirecting.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0 (url-http-debug &qu=
ot;Maximum redirections reached&quot;)</font></div><div><font face=3D"&#39;=
courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-=
space:pre">	</span> =A0 =A0 =A0 (setf (car url-callback-arguments)</font></=
div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 =A0 (nconc (list :error (l=
ist &#39;error &#39;http-redirect-limit</font></div><div><font face=3D"&#39=
;courier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white=
-space:pre">					</span> =A0 =A0 =A0 redirect-uri))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span> =A0 =A0(car url-callback-argu=
ments)))</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><=
span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =A0 =
=A0 (setq success t))))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (4<span cl=
ass=3D"Apple-tab-span" style=3D"white-space:pre">				</span>; Client error<=
/font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =
=A0 =A0;; 400 Bad Request</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 401 =
Unauthorized</font></div><div><font face=3D"&#39;courier new&#39;, monospac=
e">=A0 =A0 =A0 =A0;; 402 Payment required</font></div><div><font face=3D"&#=
39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 403 Forbidden</font></div=
>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 404 =
Not found</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=
=A0 =A0 =A0 =A0;; 405 Method not allowed</font></div><div><font face=3D"&#3=
9;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 406 Not acceptable</font><=
/div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 407 =
Proxy authentication required</font></div><div><font face=3D"&#39;courier n=
ew&#39;, monospace">=A0 =A0 =A0 =A0;; 408 Request time-out</font></div><div=
><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 409 Conf=
lict</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 410 =
Gone</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =
=A0 =A0 =A0;; 411 Length required</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace">=A0 =A0 =A0 =A0;; 412 Precondition failed</font></d=
iv>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 413 =
Request entity too large</font></div><div><font face=3D"&#39;courier new&#3=
9;, monospace">=A0 =A0 =A0 =A0;; 414 Request-URI too large</font></div><div=
><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 415 Unsu=
pported media type</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 416 =
Requested range not satisfiable</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace">=A0 =A0 =A0 =A0;; 417 Expectation failed</font></div>=
<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 422 =
Unprocessable Entity (Added by DAV)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 423 =
Locked</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0=
 =A0 =A0 =A0;; 424 Failed Dependency</font></div><div><font face=3D"&#39;co=
urier new&#39;, monospace">=A0 =A0 =A0 =A0(case status-symbol</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (unauthorized<span class=3D"App=
le-tab-span" style=3D"white-space:pre">			</span>; 401</font></div><div><fo=
nt face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">	</span> =A0;; The request requires user authent=
ication. =A0The response</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; MUST include a WWW-Authen=
ticate header field containing a</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; challenge applicable to the requested resource. =A0The<=
/font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; client MAY repeat the req=
uest with a suitable</font></div><div><font face=3D"&#39;courier new&#39;, =
monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span=
> =A0;; Authorization header field.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><br></font></div><div>=
<font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 ;; bug =
patch because url-http-handle-authentication</font></div><div><font face=3D=
"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 ;; might return a ne=
w buffer</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><br></font></div><div>=
<font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 (let ((=
retval (url-http-handle-authentication nil)))</font></div><div><font face=
=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =A0 (url-http-deb=
ug &quot;Url Http Parse Headers: handling authentication return buffer TO %=
s&quot; retval)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 (when retval</font></div><div><font face=3D"&#39;courier new&#39;, mono=
space">=A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; Put in the current buffer a forwardin=
g pointer to the new</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 ;; destination buffer.</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =A0 =A0 ;; FIXME: This is a hack t=
o fix url-retrieve-synchronously</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 ;; without changing the API. =A0Instead url-retrieve should</font><=
/div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =
=A0 =A0 =A0 ;; either simply not return the &quot;destination&quot; buffer,=
 or it</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 ;; should take an optional `dest-buf&#39; argument.</font></div><di=
v><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =A0 =
=A0 (set (make-local-variable &#39;url-redirect-buffer)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0retval)</font></div><div><font face=3D"&#39;courier new&=
#39;, monospace">=A0 =A0 =A0 =A0 =A0 =A0 =A0 (url-http-debug &quot;Url Http=
 Parse Headers: handling authentication return buffer TO %s -&gt; %s 2:&quo=
t;</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 retval url-redirect-buffer)</font><=
/div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =
=A0 =A0 =A0 (url-mark-buffer-as-dead buffer))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0</f=
ont></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">	</span> (payment-required =
=A0 =A0 =A0 =A0 =A0 =A0 =A0; 402</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; This code is reserved for=
 future use</font></div><div><font face=3D"&#39;courier new&#39;, monospace=
"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0(url=
-mark-buffer-as-dead buffer)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(error &quot;Somebody wants =
you to give them money&quot;))</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> (forbidden<span class=3D"Apple-tab-span" style=3D"white-space:p=
re">			</span>; 403</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The server understood the=
 request, but is refusing to</font></div><div><font face=3D"&#39;courier ne=
w&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
>	</span> =A0;; fulfill it. =A0Authorization will not help and the request<=
/font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; SHOULD NOT be repeated.</=
font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0(setq success t))=
</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (not-found<span class=3D"Apple-=
tab-span" style=3D"white-space:pre">			</span>; 404</font></div><div><font =
face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" st=
yle=3D"white-space:pre">	</span> =A0;; Not found</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (method-not-allowed<span clas=
s=3D"Apple-tab-span" style=3D"white-space:pre">		</span>; 405</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The method specified in t=
he Request-Line is not allowed</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0;; for the resource identified by the Request-URI. =A0The</f=
ont></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; response MUST include an =
Allow header containing a list of</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span> =A0;; valid methods for the requested resource.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (not-acceptable<span class=3D=
"Apple-tab-span" style=3D"white-space:pre">		</span>; 406</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The resource identified b=
y the request is only capable of</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; generating response entities which have content</font><=
/div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; characteristics nota ccep=
table according to the accept</font></div><div><font face=3D"&#39;courier n=
ew&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre=
">	</span> =A0;; headers sent in the request.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (proxy-authentication-require=
d ; 407</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; This code is similar to 4=
01 (Unauthorized), but indicates</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; that the client must first authenticate itself with the=
</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; proxy. =A0The proxy MUST =
return a Proxy-Authenticate header</font></div><div><font face=3D"&#39;cour=
ier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre">	</span> =A0;; field containing a challenge applicable to the proxy =
for</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; the requested resource.</=
font></div><div><font face=3D"&#39;courier new&#39;, monospace"><br></font>=
</div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 ;;=
 bug patch because url-http-handle-authentication</font></div><div><font fa=
ce=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 ;; might return=
 a new buffer</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0=A0=
</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =
=A0 =A0 =A0 (let ((retval (url-http-handle-authentication t)))</font></div>=
<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0=A0=
</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 (when retval</font></div><div><font face=3D"&#39;courier new&#39;, mono=
space">=A0 =A0 =A0 =A0 =A0 =A0 ;; Put in the current buffer a forwarding po=
inter to the new</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 ;; destination buffer.</fo=
nt></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">		</span> =A0 ;; FIXME: This =
is a hack to fix url-retrieve-synchronously</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 ;; without changing the AP=
I. =A0Instead url-retrieve should</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">		</span> =A0 ;; either simply not return the &quot;destination&quot;=
 buffer, or it</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">		</span> =A0 ;; should take an optional=
 `dest-buf&#39; argument.</font></div><div><font face=3D"&#39;courier new&#=
39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">		=
</span> =A0 (set (make-local-variable &#39;url-redirect-buffer)</font></div=
>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 retval)</font></div><div><font face=3D"&#39;cou=
rier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spa=
ce:pre">		</span> =A0 (url-mark-buffer-as-dead buffer))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0 =A0=A0=
</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span cla=
ss=3D"Apple-tab-span" style=3D"white-space:pre">	</span> (request-timeout<s=
pan class=3D"Apple-tab-span" style=3D"white-space:pre">		</span>; 408</font=
></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The client did not produc=
e a request within the time that</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; the server was prepared to wait. =A0The client MAY repe=
at</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; the request without modif=
ications at any later time.</font></div><div><font face=3D"&#39;courier new=
&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
	</span> =A0(setq success t))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (conflict<span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">			</span>; 409</font></div><div><font f=
ace=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" sty=
le=3D"white-space:pre">	</span> =A0;; The request could not be completed du=
e to a conflict with</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; the current state of the =
resource. =A0This code is only</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0;; allowed in situations where it is expected that the user<=
/font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; mioght be able to resolve=
 the conflict and resubmit the</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0;; request. =A0The response body SHOULD include enough</font=
></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; information for the user =
to recognize the source of the</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0;; conflict.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (gone =A0 =A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0; 410</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The requested resource is=
 no longer available at the</font></div><div><font face=3D"&#39;courier new=
&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
	</span> =A0;; server and no forwarding address is known.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (length-required<span class=
=3D"Apple-tab-span" style=3D"white-space:pre">		</span>; 411</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The server refuses to acc=
ept the request without a defined</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span> =A0;; Content-Length. =A0The client MAY repeat the request i=
f it</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; adds a valid Content-Leng=
th header field containing the</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0;; length of the message-body in the request message.</font>=
</div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;;</font></div><div><font fa=
ce=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" styl=
e=3D"white-space:pre">	</span> =A0;; NOTE - this will never happen because<=
/font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; `url-http-create-request&=
#39; automatically calculates the</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span> =A0;; content-length.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (precondition-failed<span cla=
ss=3D"Apple-tab-span" style=3D"white-space:pre">		</span>; 412</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The precondition given in=
 one or more of the</font></div><div><font face=3D"&#39;courier new&#39;, m=
onospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>=
 =A0;; request-header fields evaluated to false when it was</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; tested on the server.</fo=
nt></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=
=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0(setq success t))=
</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> ((request-entity-too-large requ=
est-uri-too-large) ; 413 414</font></div><div><font face=3D"&#39;courier ne=
w&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre"=
>	</span> =A0;; The server is refusing to process a request because the</fo=
nt></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; request entity|URI is lar=
ger than the server is willing or</font></div><div><font face=3D"&#39;couri=
er new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space=
:pre">	</span> =A0;; able to process.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (unsupported-media-type<span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>; 415</font></di=
v>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The server is refusing to=
 service the request because the</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; entity of the request is in a format not supported by t=
he</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; requested resource for th=
e requested method.</font></div><div><font face=3D"&#39;courier new&#39;, m=
onospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>=
 =A0(setq success t))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (requested-range-not-satisfiabl=
e ; 416</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><s=
pan class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0;; A ser=
ver SHOULD return a response with this status code if</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; a request included a Rang=
e request-header field, and none</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; of the range-specifier values in this field overlap the=
</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; current extent of the sel=
ected resource, and the request</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span> =A0;; did not include an If-Range request-header field.</font>=
</div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (expectation-failed<span clas=
s=3D"Apple-tab-span" style=3D"white-space:pre">		</span>; 417</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The expectation given in =
an Expect request-header field</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0;; could not be met by this server, or, if the server is a</=
font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; proxy, the server has una=
mbiguous evidence that the</font></div><div><font face=3D"&#39;courier new&=
#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	=
</span> =A0;; request could not be met by the next-hop server.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0(setq success t))</font></di=
v><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple=
-tab-span" style=3D"white-space:pre">	</span> (otherwise</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The request could not be =
understood by the server due to</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span> =A0;; malformed syntax. =A0The client SHOULD NOT repeat the</f=
ont></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; request without modificat=
ions.</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><spa=
n class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0(setq succ=
ess t)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; Tell=
 the callback that an error occurred, and what the</font></div><div><font f=
ace=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; status code was.=
</font></div><div>

<font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0(when succes=
s</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span cl=
ass=3D"Apple-tab-span" style=3D"white-space:pre">	</span> (setf (car url-ca=
llback-arguments)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0 (nconc (list :error=
 (list &#39;error &#39;http url-http-response-status))</font></div><div><fo=
nt face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">		</span> =A0 =A0 =A0(car url-callback-arguments=
)))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (5</font><=
/div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;;=
 500 Internal server error</font></div><div><font face=3D"&#39;courier new&=
#39;, monospace">=A0 =A0 =A0 =A0;; 501 Not implemented</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 502 =
Bad gateway</font></div><div><font face=3D"&#39;courier new&#39;, monospace=
">=A0 =A0 =A0 =A0;; 503 Service unavailable</font></div><div><font face=3D"=
&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 504 Gateway time-out</f=
ont></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; 505 =
HTTP version not supported</font></div><div><font face=3D"&#39;courier new&=
#39;, monospace">=A0 =A0 =A0 =A0;; 507 Insufficient storage</font></div><di=
v><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0(setq succ=
ess t)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0(case u=
rl-http-response-status</font></div><div><font face=3D"&#39;courier new&#39=
;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</s=
pan> (not-implemented<span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">		</span>; 501</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The server does not suppo=
rt the functionality required to</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; fulfill the request.</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0nil)</font></div><div><font =
face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" st=
yle=3D"white-space:pre">	</span> (bad-gateway<span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">			</span>; 502</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The server, while acting =
as a gateway or proxy, received</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span> =A0;; an invalid response from the upstream server it accessed=
</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; in attempting to fulfill =
the request.</font></div><div><font face=3D"&#39;courier new&#39;, monospac=
e"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0nil=
)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (service-unavailable<span class=
=3D"Apple-tab-span" style=3D"white-space:pre">		</span>; 503</font></div><d=
iv><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab=
-span" style=3D"white-space:pre">	</span> =A0;; The server is currently una=
ble to handle the request due</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; to a temporary overloadin=
g or maintenance of the server.</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span> =A0;; The implication is that this is a temporary condition</f=
ont></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; which will be alleviated =
after some delay. =A0If known, the</font></div><div><font face=3D"&#39;cour=
ier new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-spac=
e:pre">	</span> =A0;; length of the delay MAY be indicated in a Retry-After=
</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; header. =A0If no Retry-Af=
ter is given, the client SHOULD</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span> =A0;; handle the response as it would for a 500 response.</fon=
t></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0nil)</font></div><div><font =
face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span" st=
yle=3D"white-space:pre">	</span> (gateway-timeout<span class=3D"Apple-tab-s=
pan" style=3D"white-space:pre">		</span>; 504</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; The server, while acting =
as a gateway or proxy, did not</font></div><div><font face=3D"&#39;courier =
new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pr=
e">	</span> =A0;; receive a timely response from the upstream server</font>=
</div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; specified by the URI (e.g=
. HTTP, FTP, LDAP) or some other</font></div><div><font face=3D"&#39;courie=
r new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:=
pre">	</span> =A0;; auxiliary server (e.g. DNS) it needed to access in</fon=
t></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; attempting to complete th=
e request.</font></div><div><font face=3D"&#39;courier new&#39;, monospace"=
><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0nil)<=
/font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (http-version-not-supported<spa=
n class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>; 505</font></=
div><div>

<font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-sp=
an" style=3D"white-space:pre">	</span> =A0;; The server does not support, o=
r refuses to support, the</font></div><div><font face=3D"&#39;courier new&#=
39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	<=
/span> =A0;; HTTP protocol version that was used in the request</font></div=
>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; message.</font></div><div=
><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-s=
pan" style=3D"white-space:pre">	</span> =A0nil)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> (insufficient-storage<span clas=
s=3D"Apple-tab-span" style=3D"white-space:pre">		</span>; 507 (DAV)</font><=
/div>
<div>
<font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-sp=
an" style=3D"white-space:pre">	</span> =A0;; The method could not be perfor=
med on the resource</font></div><div><font face=3D"&#39;courier new&#39;, m=
onospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>=
 =A0;; because the server is unable to store the representation</font></div=
>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; needed to successfully co=
mplete the request. =A0This</font></div><div><font face=3D"&#39;courier new=
&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:pre">=
	</span> =A0;; condition is considered to be temporary. =A0If the request</=
font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; which received this statu=
s code was the result of a user</font></div><div><font face=3D"&#39;courier=
 new&#39;, monospace"><span class=3D"Apple-tab-span" style=3D"white-space:p=
re">	</span> =A0;; action, the request MUST NOT be repeated until it is</fo=
nt></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0;; requested by a separate u=
ser action.</font></div><div><font face=3D"&#39;courier new&#39;, monospace=
"><span class=3D"Apple-tab-span" style=3D"white-space:pre">	</span> =A0nil)=
)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; Tell=
 the callback that an error occurred, and what the</font></div><div><font f=
ace=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0;; status code was.=
</font></div><div>

<font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 =A0(when succes=
s</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span cl=
ass=3D"Apple-tab-span" style=3D"white-space:pre">	</span> (setf (car url-ca=
llback-arguments)</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-t=
ab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0 (nconc (list :error=
 (list &#39;error &#39;http url-http-response-status))</font></div><div><fo=
nt face=3D"&#39;courier new&#39;, monospace"><span class=3D"Apple-tab-span"=
 style=3D"white-space:pre">		</span> =A0 =A0 =A0(car url-callback-arguments=
)))))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =A0 (otherwise=
</font></div><div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 =
=A0 =A0(error &quot;Unknown class of HTTP response code: %d (%d)&quot;</fon=
t></div><div><font face=3D"&#39;courier new&#39;, monospace"><span class=3D=
"Apple-tab-span" style=3D"white-space:pre">	</span> =A0 =A0 =A0class url-ht=
tp-response-status)))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (if (not succe=
ss)</font></div><div><font face=3D"&#39;courier new&#39;, monospace"><span =
class=3D"Apple-tab-span" style=3D"white-space:pre">	</span>(url-mark-buffer=
-as-dead buffer))</font></div>

<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (url-http-debu=
g &quot;Finished parsing HTTP headers: %S&quot; success)</font></div><div><=
font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 (widen)</font></div>=
<div><font face=3D"&#39;courier new&#39;, monospace">=A0 =A0 success))</fon=
t></div>

</div><div><br></div><div><br></div><div><br></div>

--14dae934061b6b464204b63bf1f8--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#10478; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Jan 2012 07:10:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 11 02:10:57 2012
Received: from localhost ([127.0.0.1]:53150 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1RksKm-0004B9-GA
	for submit <at> debbugs.gnu.org; Wed, 11 Jan 2012 02:10:57 -0500
Received: from eggs.gnu.org ([140.186.70.92]:45651)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <jerry.asher@HIDDEN>) id 1RksE7-00041n-R9
	for submit <at> debbugs.gnu.org; Wed, 11 Jan 2012 02:04:05 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jerry.asher@HIDDEN>) id 1RksDf-0004M3-Dq
	for submit <at> debbugs.gnu.org; Wed, 11 Jan 2012 02:03:36 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_LOW,T_DKIM_INVALID autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([140.186.70.17]:41355)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jerry.asher@HIDDEN>) id 1RksDf-0004Lx-CI
	for submit <at> debbugs.gnu.org; Wed, 11 Jan 2012 02:03:35 -0500
Received: from eggs.gnu.org ([140.186.70.92]:41141)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jerry.asher@HIDDEN>) id 1RksDe-0002ab-0u
	for bug-gnu-emacs@HIDDEN; Wed, 11 Jan 2012 02:03:35 -0500
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jerry.asher@HIDDEN>) id 1RksDc-0004LZ-3h
	for bug-gnu-emacs@HIDDEN; Wed, 11 Jan 2012 02:03:33 -0500
Received: from mail-iy0-f169.google.com ([209.85.210.169]:54604)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jerry.asher@HIDDEN>) id 1RksDb-0004LS-Tn
	for bug-gnu-emacs@HIDDEN; Wed, 11 Jan 2012 02:03:32 -0500
Received: by iafj26 with SMTP id j26so778207iaf.0
	for <bug-gnu-emacs@HIDDEN>; Tue, 10 Jan 2012 23:03:31 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:from:date:message-id:subject:to:content-type;
	bh=wY8f0sm5glp3HaoRijYG1CoOLsKBSiCn0AfEnXA2G0M=;
	b=WNkizb8uQ9Jfc1EJbBC4wDktNa0rTDJ3fwfnKvGHZibARUJCt0s7c+VNT7EBPiXrOz
	8HNLoan63aa/F6HjH0dwL1pIzDbwVvnDYSbcQXZcJ+CWZul21e88yQRPwxqoGdQnBS7R
	KYOaNoHgqgBG2EgghfH/4IgsHTImzppBhFB0M=
Received: by 10.50.184.166 with SMTP id ev6mr5692467igc.2.1326265409810; Tue,
	10 Jan 2012 23:03:29 -0800 (PST)
MIME-Version: 1.0
Received: by 10.42.218.74 with HTTP; Tue, 10 Jan 2012 23:03:06 -0800 (PST)
From: Jerry Asher <jerry.asher@HIDDEN>
Date: Wed, 11 Jan 2012 00:03:06 -0700
Message-ID: <CAEtC88V2G5j9dApZW3x8qrs0ecxLGP65PicaruN3pe-kjOiiBQ@HIDDEN>
Subject: 24.0.50; url-http-parse-headers can silently drop the response when
	handling BASIC AUTHENTICATION
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.186.70.17
X-Spam-Score: -3.4 (---)
X-Debbugs-Envelope-To: submit
X-Mailman-Approved-At: Wed, 11 Jan 2012 02:10:54 -0500
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -3.4 (---)

From: Jerry Asher <jerry.asher@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 24.0.50; url-http-parse-headers can silently drop the
response when handling BASIC AUTHENTICATION
Date: Tue, 10 Jan 2012 23:59:59 -0700
Message-ID: <87zkduafm8.fsf@HIDDEN>
--text follows this line--
I am developing an interface to posterous.com.  Posterous has a restful
api described at posterous.com/api.

They require basic authentication.

When making a GET request again their simplest api, users/me that
returns information about the logged in user, url-retrieve-synchronously
will return the wrong buffer.

This seems to be traceable to url-http-parse-headers handling the "401
Basic: Access denied message by" calling url-http-handle-authentication
which prompts the user for a name and password and calls
url-retrieve-internal to retry the request.

This time, url-retrieve-internal will add in the authentication header,
and so the request will succeed in a 200.  At that point
url-retrieve-will return the buffer the response is in,
url-http-handle-authentication will return that buffer, but
url-http-parse-header will drop that new buffer on the floor, silently.

In a similar case, url-http-parse-header will for a 30X redirect uris,
set a buffer local variable url-redirect-buffer.

It would seem that something similar to this needs to be done for 401
Unauthorized basic authentication.



In GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7601)
 of 2011-09-19 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 6.1.7601
configured using `configure --with-gcc (4.5) --no-opt'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Emacs-Lisp

Minor modes in effect:
  eldoc-mode: t
  display-time-mode: t
  desktop-save-mode: t
  projectile-global-mode: t
  yas/global-mode: t
  shell-dirtrack-mode: t
  recentf-mode: t
  savehist-mode: t
  electric-layout-mode: t
  electric-indent-mode: t
  global-auto-revert-mode: t
  delete-selection-mode: t
  show-paren-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  size-indication-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: 1

Recent input:
C-s C-s C-s C-l C-a C-n C-n C-n C-n C-n C-n C-f C-a
C-s C-a C-s u r l - h t t p - h a n d l e - a u C-s
C-s C-r C-r C-r C-a C-a C-s u r l - b a s i c - a C-s
C-a C-x 2 C-x o <escape> x f i n d - g r e p <return>
u r l - b u g - a d C-a C-f C-f C-f C-f C-f C-f C-f
- n a m e SPC * <backspace> " * e l " SPC C-e <return>
C-x p C-x p q C-x p C-x 0 C-x o C-a C-s u r l - t <backspace>
r e t r i C-a <escape> C-f C-e <escape> C-b C-s u r
l - h t t p - h a n d l e - a u t h e t <backspace>
n t i c a t i o n C-a C-x o C-x b * U R <tab> <return>
C-s h a n d l i n e <backspace> g C-s C-a C-x o C-x
2 C-x o <escape> x <up> <return> <up> C-e C-b C-b C-b
C-b C-b C-b <escape> <backspace> <escape> <backspace>
h t t p - h a n d l e <return> <escape> < C-s h r l
- <backspace> <backspace> <backspace> <backspace> u
r l - h a n d l <backspace> <backspace> <backspace>
<backspace> t t p - h a n d l e - a C-s C-s C-r C-r
C-a C-l C-x 1 C-e C-b <down-mouse-1> <mouse-1> C-x
3 <escape> x r p o <backspace> <backspace> e p o r
t - b u g <escape> b e m a c s - <return>

Recent messages:
Mark saved where search started
Mark set
Mark saved where search started
Mark set
Mark saved where search started [3 times]
Grep finished (matches found)
Mark saved where search started [3 times]
Grep finished (matches found)
Mark set
Mark saved where search started

Load-path shadows:
c:/users/jerry/d/Dropbox/emacs/site/site-start hides c:/Program Files
(x86)/emacs/emacs-24.0.50/../site-lisp/site-start
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/ezimage hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/ezimage
c:/users/jerry/d/Dropbox/emacs-prelude/personal/custom hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/custom
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/pulse hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/cedet/pulse
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/mode-local hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/cedet/mode-local
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/inversion hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/cedet/inversion
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/data-debug hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/cedet/data-debug
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/cedet hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/cedet/cedet
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/cedet-idutils
hides c:/Program Files
(x86)/emacs/emacs-24.0.50/lisp/cedet/cedet-idutils
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/cedet-global
hides c:/Program Files
(x86)/emacs/emacs-24.0.50/lisp/cedet/cedet-global
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/cedet-files hides
c:/Program Files (x86)/emacs/emacs-24.0.50/lisp/cedet/cedet-files
c:/users/jerry/d/Dropbox/emacs/site/cedet-1.0/common/cedet-cscope
hides c:/Program Files
(x86)/emacs/emacs-24.0.50/lisp/cedet/cedet-cscope

Features:
(shadow mail-extr message rfc822 mml mml-sec mm-decode mm-bodies
mm-encode mailabbrev gmm-utils mailheader emacsbug grep dired-aux
url-cache apropos cus-edit cus-start cus-load mail-utils network-stream
starttls debug posterous url-http tls url-auth mail-parse rfc2231
rfc2047 rfc2045 ietf-drums url-gw url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-util url-parse url-vars mailcap
paredit find-func multi-isearch mule-util help-mode view time-stamp
vc-git eldoc dired time desktop prelude-xml prelude-scheme prelude-ruby
feature-mode cucumber-mode scss-mode flymake compile derived haml-mode
js json newcomment cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles
cc-align cc-engine cc-vars cc-defs markdown-mode noutline outline
css-mode ruby-end ruby-block easy-mmode ruby-mode yari ansi-color
prelude-markdown prelude-emacs-lisp prelude-common-lisp prelude-lisp
prelude-c prelude-global-keybindings prelude-editor projectile yasnippet
edmacro kmacro tramp tramp-compat auth-source eieio assoc gnus-util
mm-util mail-prsvr password-cache shell pcomplete format-spec
tramp-loaddefs windmove recentf tree-widget wid-edit savehist saveplace
uniquify electric autorevert delsel prelude-core byte-opt warnings
bytecomp byte-compile cconv macroexp imenu thingatpt prelude-packages
anything-autoloads auctex-autoloads tex-site info easymenu
clojure-mode-autoloads coffee-mode-autoloads deft-autoloads
gist-autoloads haskell-mode-autoloads icomplete+-autoloads
lacarte-autoloads magit-autoloads markdown-mode-autoloads
paredit-autoloads projectile-autoloads sass-mode-autoloads
haml-mode-autoloads scss-mode-autoloads slime-autoloads
synonyms-autoloads wgrep-autoloads yaml-mode-autoloads yari-autoloads
yasnippet-autoloads package tabulated-list prelude-ui url-coding paren
sort cygwin-mount ange-ftp comint regexp-opt ring executable cl server
advice help-fns advice-preload time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer button faces cus-face files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
multi-tty emacs)




Acknowledgement sent to Jerry Asher <jerry.asher@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#10478; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 25 Dec 2015 22:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.