rwbr / exmlrpc Goto Github PK
View Code? Open in Web Editor NEWAn HTTP 1.1 compliant XML-RPC library for Erlang
License: Other
An HTTP 1.1 compliant XML-RPC library for Erlang
License: Other
Hi
I get the following error when using exmlrpc with ejabberd.
=CRASH REPORT==== 11-Oct-2011::16:00:13 ===
crasher:
initial call: tcp_serv:init/2
pid: <0.384.0>
registered_name: []
exception error: no function clause matching
gen_tcp:mod({ip,{0,0,0,0}},undefined)
in function gen_tcp:listen/2
in call from tcp_serv:init/2
ancestors: [ejabberd_listeners,ejabberd_sup,<0.36.0>]
messages: []
links: [<0.263.0>]
dictionary: []
trap_exit: true
status: running
heap_size: 377
stack_size: 24
reductions: 94
neighbours:
I use ejabberd2.1.6 and erlang R14B03.
ejabberd.cfg contains
{4560, ejabberd_xmlrpc, [{maxsessions, 10}, {timeout, 5000}]}
Could you please tell me if this is a known problem or if there is something wrong? TIA.
Regards
Balakrishnan.
last.fm uses the XMLRPC server at ws.audioscrobbler.com. Using the example Python code for accessing this server works fine, but using the equivalent for Erlang didn't work. Studying the output with Wireshark, I noticed that Erlang wasn't outputting a Host header, and started digging into the XMLRPC code. Hacking a Host header manually into the POST fixed the basic bug, but other issues cropped up (the request comes back as "HTTP/1.0 200 OK" not HTTP/1.1), and they all appeared to come back to being a result of manually building/parsing the HTTP request as opposed to using the inets http client, which would seems the sensible option to me!
Problem with rewriting the xmlrpc module like that is that call/3 and call/5 wouldn't work as inets won't let you specify the socket to use AFAIK, and I can't seem to figure out how to set KeepAlive with that, but it still seems like a sensible option.
Example code used for testing:
-module(lastfm). -export([start/0]). start() -> io:format("~p~n", [artist()]). artist() -> case xmlrpc:call("ws.audioscrobbler.com", 80, "/2.0/", {call, artist.search, [{struct,[{artist,"blah"}]}]}, false, 10000) of {error, Reason} -> {error, Reason}; {ok, Result} -> Result end.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.