XML-RPC interface resets the connection before providing the actual results. I have identified that versions 1.90 and above have this bug. The code that I have attached works fine on 1.83 and below. Using the command aria2.shutdown shows that the XML-RPC server receives the command and acts on it. A network trace shows the following:
POST /rpc HTTP/1.0
Host: inversion:6800
User-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)
Content-Length: 109
Content-Type: text/xml
<methodcall>
<methodname>aria2.getVersion</methodname>
<params>
</params>
</methodcall>
HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 608
Connection: close
The length shows there is data but the connection is reset before it is sent. The reset is initiated by the server.
PHP script to communicate with XML-RPC
I could not have reproduced this issue so far. aria2.getVersion() returns correctly.
I used aria2-1.9.3 and Python-2.6.5 interpreter on Windows7(I assumed you are using windows because aria2c.exe is mentioned in the attached file).
Could you provide me aria2's log(see -l option)?
Log of failed output
Try using my script with the windows binaries of PHP 5.3.2. Just change the $host for your system.
When using the --log= option, it would work fine when I used just a dash, but when I tried to log to a file it would fail. The result on the console were identical to the log file though.
I have attached the log from the failed test.
I ran bug.php (using php5.3.2) against aria2-1.9.3. I got good response once, but all subsequent requests failed.
Next, I ran bug.php against aria2-1.8.3. I got good response, but sometimes got error(same as 1.9.3).
I saw that bug occurs when -l was not used.
Regardless of version and use of -l option, python's xmlrpclib works perfectly.
This is very strange to me why python works but php fails.