summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark A. Hershberger <mah@everybody.org>2010-02-26 22:36:40 -0500
committerMark A. Hershberger <mah@everybody.org>2015-05-29 09:55:34 -0400
commitfa2aee2be9bd740951dda06d10e40ec1a5a99e35 (patch)
tree169353760389742d76ea8aff67f9f1c1e36674b2
parent7b4d6c48205a6855062ce29dad4c6b6687ae282a (diff)
(xml-rpc-request-process-buffer): Make regex less picky to avoid some problems with CVS Emacs. (xml-rpc-xml-list-to-value): Take away dependency on rfc2047.el. (xml-rpc-base64-decode-unicode): New variable.
-rw-r--r--xml-rpc.el25
1 files changed, 16 insertions, 9 deletions
diff --git a/xml-rpc.el b/xml-rpc.el
index 2770b3e..3c52a3a 100644
--- a/xml-rpc.el
+++ b/xml-rpc.el
@@ -233,7 +233,7 @@ interpreting and simplifying it while retaining its structure."
(cond
;; Base64
((eq valtype 'base64)
- (rfc2047-decode "utf-8" "B" valvalue))
+ (rfc2047-decode "utf-8" ?B valvalue))
;; Boolean
((eq valtype 'boolean)
(xml-rpc-string-to-boolean valvalue))
@@ -256,13 +256,15 @@ interpreting and simplifying it while retaining its structure."
;; Fault
((eq valtype 'fault)
(let* ((struct (xml-rpc-xml-list-to-value (list valvalue)))
- (fault-string (cdr (assoc "faultString" struct)))
- (fault-code (cdr (assoc "faultCode" struct))))
- (list 'fault fault-code fault-string)))
-
- ;; Array
- ((eq valtype 'array)
- (mapcar (lambda (arrval)
+ (fault-string (cdr (assoc "faultString" struct)))
+ (fault-code (cdr (assoc "faultCode" struct))))
+ (list 'fault fault-code fault-string)))
+ ;; DateTime
+ ((eq valtype 'dateTime\.iso8601)
+ valvalue)
+ ;; Array
+ ((eq valtype 'array)
+ (mapcar (lambda (arrval)
(xml-rpc-xml-list-to-value (list arrval)))
(cddr valvalue)))))
((xml-rpc-caddar-safe xml-list))))
@@ -519,7 +521,12 @@ or nil if called with ASYNC-CALLBACK-FUNCTION."
(search-forward "\n---- Error was: ----\n")))
(and errstart
(buffer-substring errstart (point-max)))))
-
+
+ ;; Maybe they just gave us an the XML w/o PI?
+ ((search-forward "<methodResponse>" nil t)
+ (xml-rpc-clean (xml-parse-region (match-beginning 0)
+ (point-max))))
+
;; Valid HTTP status
(t
(int-to-string status)))))