Http post - Connection reset while sending large data vc++

boisguckcob

New Member
My Code needs to post the xml data to the server using vc++ , am using CInternetSession for post and tinyxml for xml.If my xml data is about 8 kb the data is posted really good. But if the xml file size is around 15 kb then am receiving "The connection to the server was reset".\[code\]TiXmlDocument doc( "C:\\test.xml" );bool loadOkay = doc.LoadFile();if ( loadOkay ){ TiXmlPrinter printer; printer.SetIndent("\t"); docs.Accept( &printer ); docs.Print(); CString zURLstest = printer.CStr(); #define MAX_READ_BUFFER 102400 CInternetSession* p_CInternetSession; CHttpFile* p_HttpFile; CStdioFile* p_File; char z_ResponseBuff [MAX_READ_BUFFER]; ULONG ul_ReadLen; CFile cFResponce; p_CInternetSession = new CInternetSession(NULL,1,PRE_CONFIG_INTERNET_ACCESS,NULL,NULL,0); p_CInternetSession->SetOption(INTERNET_OPTION_CONNECT_TIMEOUT,10000); p_CInternetSession->SetOption(INTERNET_OPTION_CONNECT_RETRIES, 3); CString zURL = "http://xxx.xxx.xxx.x/Test/TestServlet?Data="http://stackoverflow.com/questions/14597976/; CString zDWURL(zURL + zURLstest); p_File = p_CInternetSession->OpenURL(zDWURL, 1, INTERNET_FLAG_TRANSFER_BINARY|INTERNET_FLAG_DONT_CACHE); AfxMessageBox(zDWURL); p_HttpFile = (CHttpFile*)p_File; ul_ReadLen = p_HttpFile->Read (z_ResponseBuff, MAX_READ_BUFFER); DWORD dwError; p_HttpFile->QueryInfoStatusCode(dwError); if(dwError==200) { AfxMessageBox("Data updated successfully"); remove(c:\\test.xml"); }}\[/code\]Any ideas, or suggestions to fix this problem
 
Back
Top