xmlNanoHTTPRead



HI folks

I have the follwing problem wondered if you can help.

I use the follwing code from the nanohttp.h library from the libxml2

ctxt = xmlNanoHTTPMethod(sURL,"POST",NULL,&contentType,sXML1,len);

if (ctxt == NULL)
{
   xmlGenericError(xmlGenericErrorContext,"%s %s failed\n", "POST",sURL);
return(NULL);
}

It works fine sending a request to my HTTP server.

I then want to send back a response

HTTP Server sending response

if (send(sClientSocket, szResponse, strlen(szResponse), 0) == SOCKET_ERROR)
{
	*WSAError = WSAGetLastError();
	ErrMsgOut(ERR_LOG, "SendResponse():send(): error %d\n", *WSAError);
	return SEND_ERROR;
}
return SEND_OK;
}

CLient getting response

output = xmlBufferCreate ();
if (output == NULL) return -1;

len = xmlNanoHTTPRead (ctxt, output, sizeof (output));

xmlNanoHTTPClose(ctxt);

The send client returns the number of bytes sent but the xmlNanoHTTPRead returns 0 and I get no data back.

What could be wrong

Thanks in advance






_________________________________________________________________
MSN Messenger - fast, easy and FREE! http://messenger.msn.co.uk




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]