[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] scratch/with-url 41f9cda 5/7: Allow a global debugging swi
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] scratch/with-url 41f9cda 5/7: Allow a global debugging switch for easier debugging |
Date: |
Sat, 21 Jan 2017 23:08:22 +0000 (UTC) |
branch: scratch/with-url
commit 41f9cda0c16a44d83db0a37d895748ae20296c55
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Allow a global debugging switch for easier debugging
---
lisp/url/with-url.el | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/lisp/url/with-url.el b/lisp/url/with-url.el
index 91414bf..30e13ca 100644
--- a/lisp/url/with-url.el
+++ b/lisp/url/with-url.el
@@ -155,7 +155,7 @@ and `base64'."
:timeout ,timeout
:read-timeout ,read-timeout
:verbose ,verbose
- :debug ,(or with-url-debug debug)
+ :debug ,debug
:cookies ,cookies
:cache ,cache
:headers ',headers
@@ -316,7 +316,8 @@ If given, return the value in BUFFER instead."
(url-filename parsed))
(if (and (equal (url-request-method req) "GET")
(url-request-data req))
- (concat "?" (caddr (with-url--data req 'url-encode)))
+ (concat "?" (cl-caddr
+ (with-url--data req 'url-encode)))
"")))
(let* ((data (with-url--data req))
(headers
@@ -326,11 +327,12 @@ If given, return the value in BUFFER instead."
(list "Accept-Encoding"
(and (fboundp 'zlib-available-p)
(zlib-available-p)
+ nil
"gzip"))
(list "Accept" "*/*")
(list "Content-Type" (car data))
(list "Content-Transfer-Encoding" (cadr data))
- (list "Content-Length" (length (caddr data)))
+ (list "Content-Length" (length (cl-caddr data)))
(list "Cookies"
(and (memq (url-request-cookies req) '(t write))
(with-url--cookies parsed)))
@@ -349,8 +351,9 @@ If given, return the value in BUFFER instead."
do (insert (format "%s: %s\r\n" name value)))
(insert "\r\n")
(when data
- (insert (caddr data)))
- (when (url-request-debug req)
+ (insert (cl-caddr data)))
+ (when (or (url-request-debug req)
+ with-url-debug)
(with-url--debug 'request (buffer-string)))))
(process-send-region process (point-min) (point-max))))
@@ -449,7 +452,8 @@ If given, return the value in BUFFER instead."
(when (and (memq (url-request-cookies req) '(t read))
(url-header 'cookie))
(url-cookie-handle-set-cookie (url-header 'cookie)))
- (when (url-request-debug req)
+ (when (or (url-request-debug req)
+ with-url-debug)
(with-url--debug 'response (buffer-string)))
(cond
;; We got the expected response.
- [Emacs-diffs] scratch/with-url updated (7355274 -> f74e07b), Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url b4ee883 4/7: Get the HTML redirect right (for duck duck go)., Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 954aecf 2/7: Actually send over the HTTP headers, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url f74e07b 7/7: Get the "peer closes connection first" case right, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url e331a03 6/7: Remove debugging, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 94b1d02 3/7: Decompress compressed data, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 2ca3815 1/7: Convert to with-url, Lars Ingebrigtsen, 2017/01/21
- [Emacs-diffs] scratch/with-url 41f9cda 5/7: Allow a global debugging switch for easier debugging,
Lars Ingebrigtsen <=