emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 r117304: * lisp/url/url-handlers.el (url-http-par


From: Leo Liu
Subject: [Emacs-diffs] emacs-24 r117304: * lisp/url/url-handlers.el (url-http-parse-response): Remove unused autoload.
Date: Thu, 26 Jun 2014 04:02:17 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117304
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/17549
committer: Leo Liu <address@hidden>
branch nick: emacs-24
timestamp: Thu 2014-06-26 12:00:56 +0800
message:
  * lisp/url/url-handlers.el (url-http-parse-response): Remove unused autoload.
  (url-insert-file-contents): Condition on url-http-response-status
  for the HTTP/S specific part. 
  
  * lisp/url/url-http.el (url-http-end-of-headers): Remove duplicate defvar.
modified:
  lisp/url/ChangeLog             changelog-20091113204419-o5vbwnq5f7feedwu-3116
  lisp/url/url-handlers.el       
urlhandlers.el-20091113204419-o5vbwnq5f7feedwu-2987
  lisp/url/url-http.el           urlhttp.el-20091113204419-o5vbwnq5f7feedwu-2989
=== modified file 'lisp/url/ChangeLog'
--- a/lisp/url/ChangeLog        2014-05-09 12:49:30 +0000
+++ b/lisp/url/ChangeLog        2014-06-26 04:00:56 +0000
@@ -1,3 +1,11 @@
+2014-06-26  Leo Liu  <address@hidden>
+
+       * url-http.el (url-http-end-of-headers): Remove duplicate defvar.
+
+       * url-handlers.el (url-http-parse-response): Remove unused autoload.
+       (url-insert-file-contents): Condition on url-http-response-status
+       for the HTTP/S specific part.  (Bug#17549)
+
 2014-05-09  Michael Albinus  <address@hidden>
 
        * url-handlers.el (url-file-handler-load-in-progress): New defvar.

=== modified file 'lisp/url/url-handlers.el'
--- a/lisp/url/url-handlers.el  2014-05-09 12:49:30 +0000
+++ b/lisp/url/url-handlers.el  2014-06-26 04:00:56 +0000
@@ -33,7 +33,6 @@
 (autoload 'url-expand-file-name "url-expand" "Convert url to a fully specified 
url, and canonicalize it.")
 (autoload 'mm-dissect-buffer "mm-decode" "Dissect the current buffer and 
return a list of MIME handles.")
 (autoload 'url-scheme-get-property "url-methods" "Get property of a URL 
SCHEME.")
-(autoload 'url-http-parse-response "url-http" "Parse just the response code.")
 
 ;; Always used after mm-dissect-buffer and defined in the same file.
 (declare-function mm-save-part-to-file "mm-decode" (handle file))
@@ -298,17 +297,21 @@
       (insert data))
     (list (length data) charset)))
 
+(defconst url-http-codes)
+
 ;;;###autoload
 (defun url-insert-file-contents (url &optional visit beg end replace)
   (let ((buffer (url-retrieve-synchronously url)))
     (unless buffer (signal 'file-error (list url "No Data")))
     (with-current-buffer buffer
-      (let ((response (url-http-parse-response)))
-        (if (and (>= response 200) (< response 300))
-            (goto-char (point-min))
-          (let ((desc (buffer-substring-no-properties (1+ (point))
-                                                      (line-end-position))))
+      ;; XXX: This is HTTP/S specific and should be moved to url-http
+      ;; instead.  See http://debbugs.gnu.org/17549.
+      (when (bound-and-true-p url-http-response-status)
+        (unless (and (>= url-http-response-status 200)
+                     (< url-http-response-status 300))
+          (let ((desc (nth 2 (assq url-http-response-status url-http-codes))))
             (kill-buffer buffer)
+            ;; Signal file-error per http://debbugs.gnu.org/16733.
             (signal 'file-error (list url desc))))))
     (if visit (setq buffer-file-name url))
     (save-excursion
@@ -323,6 +326,7 @@
           ;; usual heuristic/rules that we apply to files.
           (decode-coding-inserted-region start (point) url visit beg end 
replace))
         (list url (car size-and-charset))))))
+
 (put 'insert-file-contents 'url-file-handlers 'url-insert-file-contents)
 
 (defun url-file-name-completion (url directory &optional predicate)

=== modified file 'lisp/url/url-http.el'
--- a/lisp/url/url-http.el      2014-01-08 18:29:16 +0000
+++ b/lisp/url/url-http.el      2014-06-26 04:00:56 +0000
@@ -47,7 +47,6 @@
 (defvar url-http-response-version)
 (defvar url-http-target-url)
 (defvar url-http-transfer-encoding)
-(defvar url-http-end-of-headers)
 (defvar url-show-status)
 
 (require 'url-gw)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]