[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/xml-rpc 8c944a1b7d 37/64: Merge pull request #1 from stsqu
From: |
Stefan Kangas |
Subject: |
[nongnu] elpa/xml-rpc 8c944a1b7d 37/64: Merge pull request #1 from stsquad/extra-headers-rebase |
Date: |
Fri, 31 Dec 2021 20:11:07 -0500 (EST) |
branch: elpa/xml-rpc
commit 8c944a1b7dca0408298f169537f780ab40b0493a
Merge: 822f5bc020 4fd5a03a36
Author: Mark A. Hershberger <mah@everybody.org>
Commit: Mark A. Hershberger <mah@everybody.org>
Merge pull request #1 from stsquad/extra-headers-rebase
Here is the pull request
---
xml-rpc.el | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/xml-rpc.el b/xml-rpc.el
index f870bd4ab1..bfc21f880d 100644
--- a/xml-rpc.el
+++ b/xml-rpc.el
@@ -246,6 +246,10 @@ Set it higher to get some info in the *Messages* buffer"
(defvar xml-rpc-fault-code nil
"Contains the fault code if a fault is returned")
+(defvar xml-rpc-request-extra-headers nil
+ "A list of extra headers to send with the next request.
+Should be an assoc list of headers/contents. See `url-request-extra-headers'")
+
;;
;; Value type handling functions
;;
@@ -560,10 +564,12 @@ or nil if called with ASYNC-CALLBACK-FUNCTION."
(url-mime-charset-string "utf-8;q=1, iso-8859-1;q=0.5")
(url-request-coding-system xml-rpc-use-coding-system)
(url-http-attempt-keepalives t)
- (url-request-extra-headers (list
- (cons "Connection" "close")
- (cons "Content-Type"
- "text/xml; charset=utf-8"))))
+ (url-request-extra-headers (append
+ (list
+ (cons "Connection" "close")
+ (cons "Content-Type"
+ "text/xml; charset=utf-8"))
+ xml-rpc-request-extra-headers)))
(when (> xml-rpc-debug 1)
(print url-request-data (create-file-buffer "request-data")))
@@ -586,7 +592,9 @@ or nil if called with ASYNC-CALLBACK-FUNCTION."
result)))
(t ; Post emacs20 w3-el
(if async-callback-function
- (url-retrieve server-url async-callback-function)
+ (let ((cbargs (list async-callback-function)))
+ (url-retrieve server-url
+ 'xml-new-rpc-request-callback-handler
cbargs))
(let ((buffer (url-retrieve-synchronously server-url)))
(with-current-buffer buffer
(when (not (numberp url-http-response-status))
@@ -688,6 +696,12 @@ handled from XML-BUFFER."
(funcall callback-fun (xml-rpc-xml-to-response xml-response))))
+(defun xml-new-rpc-request-callback-handler (status callback-fun)
+ "Handle a new style `url-retrieve' callback passing `STATUS' and
`CALLBACK-FUN'."
+ (let ((xml-buffer (current-buffer)))
+ (xml-rpc-request-callback-handler callback-fun xml-buffer)))
+
+
(defun xml-rpc-method-call-async (async-callback-func server-url method
&rest params)
"Call an XML-RPC method asynchronously at SERVER-URL named METHOD with \
- [nongnu] elpa/xml-rpc a2cb50528c 57/64: Tidy up a bit; remove code that shouldn't be needed in modern emacs, (continued)
- [nongnu] elpa/xml-rpc a2cb50528c 57/64: Tidy up a bit; remove code that shouldn't be needed in modern emacs, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc eb50e8b116 62/64: formatting, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc a876849b45 59/64: Merge pull request #18 from skangas/fix-unit-test, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 8020ccd176 64/64: Badge++ and version bump, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc f87fef0844 10/64: Override timezone-parse-date with a version that understands the ISO8601 Basic format. (xml-rpc-value-structp): Struct test should look for consp instead of lists of a certain size. (xml-rpc-value-datetimep): Use :datetime keyword to specify data type and eliminate confusion between time structs and lists. (xml-rpc-xml-list-to-value): Grok <i4> element in addition to <int>. Return dateTime values with :datetime keyword. (xml-rpc-datetime-to-string): New function to format datetime objects. (xml-rpc-value-to-xml-list): Add handling for datetime., Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 67b151da07 02/64: initial commit, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc c0e1f70586 55/64: Bump for latest, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 21a70769f4 49/64: Don't require cl (fix #11), Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 3be458c44b 52/64: Merge pull request #12 from skangas/gitignore, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc ed03530706 58/64: Fix skip-unless condition in unit test, Stefan Kangas, 2021/12/31
- [nongnu] elpa/xml-rpc 8c944a1b7d 37/64: Merge pull request #1 from stsquad/extra-headers-rebase,
Stefan Kangas <=