51 UINT32 status, contentLength;
52 UINT8 *content = NULL;
56 MemBufInputSource *oInput = NULL;
66 if( a_postData != NULL )
75 if(status!=200|| contentLength>MAX_CONTENT_LENGTH)
79 content =
new UINT8[contentLength];
92 oInput =
new MemBufInputSource( content, contentLength,
"tmp" );
93 oParser.parse( *oInput );
98 doc = oParser.getDocument();
101 *r_elemRoot=doc.getDocumentElement();
117 return sendInfoserviceRequest(a_addr, a_strRequest, r_elemRoot, NULL, 0);
129 SINT32 CAInfoServiceAware::sendRandomInfoserviceGetRequest(
UINT8 *a_strRequest, DOM_Element *r_elemRoot)
131 return sendRandomInfoserviceRequest(a_strRequest, r_elemRoot, NULL, 0);
145 SINT32 CAInfoServiceAware::sendRandomInfoserviceRequest(
UINT8 *a_strRequest, DOM_Element *r_elemRoot,
UINT8* a_postData,
UINT32 a_postLen)
148 if( pglobalOptions->getRandomInfoService(address) !=
E_SUCCESS)
154 return sendInfoserviceRequest(address, a_strRequest, r_elemRoot, a_postData, a_postLen);
SINT32 sendGetRequest(const UINT8 *url)
Sends a HTTP GET request to the server.
SINT32 sendPostRequest(const UINT8 *url, const UINT8 *data, const UINT32 dataLen)
Sends a HTTP POST request to the server.
SINT32 getContent(UINT8 *a_pContent, UINT32 *a_pLength)
Retruns the content of the response.
SINT32 parseHTTPHeader(UINT32 *contentLength, UINT32 *statusCode=NULL, UINT32 msTimeOut=3000)
receives the HTTP header and parses the content length
SINT32 setSocket(CASocket *pSocket)
This class represents a socket address for Internet (IP) connections.
virtual SINT32 connect(const CASocketAddr &psa)