[Haskell-cafe] Strange HTTP module behavior

John Goerzen jgoerzen at complete.org
Fri Feb 18 15:14:21 EST 2005


Hello,

I am trying to send a simple SOAP message to an Apache server.  I got
the HTTP library from the XML-RPC library and thought this would make an
easy client.  However, I'm having two problems.

First, even though I am sending an accurate Content-Length header with
my POST message, the server is timing out and returning a 500 Internal
Server Error document.

Second, after reading that error document, Network.HTTP is generating an
error of its own.  Here's an strace illustrating it:

recvfrom(3, "ssResponse> </soapenv:Body>\n</soapenv:Envelope>", 1000, 0, NULL, N
ULL) = 47
recvfrom(3, "", 1000, 0, NULL, NULL)    = 0
shutdown(3, 1 /* send */)               = 0
shutdown(3, 0 /* receive */)            = 0
close(3)                                = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0
fcntl(2, F_GETFL)                       = 0x8002 (flags O_RDWR|O_LARGEFILE|0x800
0)
write(2, "\nFail: ", 7)                 = 7
write(2, "Network.Socket.recv: end of file (end of file)\n", 47) = 47
write(2, "\n", 1)                       = 1

I *think* that what's happening is that ghc threw an exception for the empty
recvfrom response, then the exception handler closed the conection, and then
the exception was prnited to stderr.

Oh, tcpdump verified that both client and server are sending Connection: close
headers.

Any ideas?

-- John


More information about the Haskell-Cafe mailing list