[s-xml-rpc-devel] Patch

Maciek Pasternacki maciekp at japhy.fnord.org
Sun Aug 27 19:45:52 UTC 2006


Hello.

I started to look at s-xml-rpc library today and to communicate with
Python client.  Python's default xmlrpclib sends no-argument methods
like this (from debug log):

,----
| <?xml version='1.0'?>
| <methodCall>
| <methodName>system.listMethods</methodName>
| <params>
| </params>
| </methodCall>12 received call ("system.listMethods" . "
| ")
`----

Library throws error from #'APPLY because last argument is a string,
not a list.  A simple patch that makes it work:

#v+ diff -u xml-rpc{-orig,}.lisp
--- xml-rpc-orig.lisp   2006-08-27 21:43:19.000000000 +0200
+++ xml-rpc.lisp        2006-08-27 21:43:25.000000000 +0200
@@ -494,6 +494,8 @@
                         ;; -32603 ---> server error. internal xml-rpc error
                         (encode-xml-rpc-fault (format nil "~a" c) -32603)))))
     (let ((call (decode-xml-rpc (debug-stream in))))
+      (unless (listp (rest call))
+        (setf (rest call) nil))
       (format-debug (or *xml-rpc-debug-stream* t) "~a received call ~s~%" id call)
       (let ((result (apply *xml-rpc-call-hook*
                            (first call)
#v-

-- 
__    Maciek Pasternacki <maciekp at japhy.fnord.org> [ http://japhy.fnord.org/ ]
`| _   |_\  /   {    Ibi nullus timet mortem
,|{-}|}| }\/                         sed pro Baccho mittunt sortem.   }
\/   |____/                                           ( Carmina Burana )  -><-



More information about the S-xml-rpc-devel mailing list