On Jul 06, 2009 at 22:39, Juha Heinanen jh@tutpro.com wrote:
Andrei Pelinescu-Onciul writes:
We could also close the connection in sr, but that would require additional code and it's the xmlrpc lib that's broken (parsing the answer only on close() is really braindamaged). However if there are lots of applications relying on the broken behaviour, I might be convinced to add the close option in sr xmlrpc.
well, python and php both are very popular for writing management software and a basic xmlrpc client written in either does not work with sr xmlrpc module. they do work with k mi_xmlrpc module which makes migration from mi_xmlrpc to xmlrpc module painful.
i would suggest to do whatever is necessary make this simple call work:
server_path = XMLRPC_PROTOCOL + '://' + XMLRPC_SERVER + \ ':' + str(XMLRPC_PORT) + XMLRPC_DIR c = xmlrpclib.ServerProxy(server_path)
if you look at any examples on the web on python xmlrpc clients, the above is what you will find. if sr requires something more complicated, it is not a good idea.
My point is that the library is broken. The perl xmlrpc:lite works perfectly:
------------------------------------------------------- use XMLRPC::Lite;
my $rpc=shift @ARGV; my $res= XMLRPC::Lite-> proxy("http://127.0.0.1:5060") -> call($rpc, @ARGV)->result;
# result printing skipped -------------------------------------------------------
Moreover with the transport workaround I posted, it works even in python.
So unless the effort of fixing existing python or php applications is not significantly greater then the effort of adding the silly close connection mode (which will disallow keeping a connection open for a long time and piping xmlrpc requests through it), I do not intend to waste any time on it. For future implementations we can document the "persistent" transport python stuff (I assume there is something similar for php too).
So whoever is interested in xmlrpc close connection after reply mode, should vote for it (but please vote only if you really have "legacy" hard to change applications that would be affected by it).
Andrei