Hello, I have reported this before and I know it is rather strange but it persists. When I make consecutive POSTs to a HTTPS server (both ICS code), it sometimes returns 10053. It happens on Win7 and Win2008, with the latter more often. Anybody sending multiple consecutive POSTs from/to ICS can see it I believe. Our code is below:
class WebClient { private: TSslContext *sslContext; AdminClient *adminClient; bool aborted; bool reallyDone; TMemoryStream *sendStream; public: TMemoryStream *receivedStream; TSslHttpCli *HTTPClient; void *HandleToPost; __fastcall WebClient(AdminClient *adminClient) { this->adminClient = adminClient; aborted = false; sendStream = new TMemoryStream(); receivedStream = new TMemoryStream(); HTTPClient = new TSslHttpCli(NULL); sslContext = new TSslContext(NULL); HTTPClient->Agent = "Fastream IQWF/IQProxy"; HTTPClient->Connection = "close"; HTTPClient->Timeout = 60; HTTPClient->SslContext = sslContext; HTTPClient->SslContext->SslVerifyPeer = false; HTTPClient->SslContext->SslVerifyPeerModes << SslVerifyMode_PEER; HTTPClient->SslContext->SslOptions << sslOpt_MICROSOFT_SESS_ID_BUG << sslOpt_NETSCAPE_CHALLENGE_BUG << sslOpt_NETSCAPE_REUSE_CIPHER_CHANGE_BUG << sslOpt_SSLREF2_REUSE_CERT_TYPE_BUG << sslOpt_MICROSOFT_BIG_SSLV3_BUFFER << sslOpt_SSLEAY_080_CLIENT_DH_BUG << sslOpt_TLS_D5_BUG << sslOpt_TLS_BLOCK_PADDING_BUG, sslOpt_TLS_ROLLBACK_BUG << sslOpt_NO_SSLv2 << sslOpt_NETSCAPE_CA_DN_BUG << sslOpt_NETSCAPE_DEMO_CIPHER_CHANGE_BUG; HTTPClient->SslContext->InitContext(); HTTPClient->SendStream = sendStream; HTTPClient->RcvdStream = receivedStream; HTTPClient->OnRequestDone = RequestDone; } __fastcall ~WebClient() { HTTPClient->OnRequestDone = NULL; HTTPClient->Abort(); delete HTTPClient; sslContext->DeInitContext(); delete sslContext; delete sendStream; delete receivedStream; } void __fastcall SendPOST(const String &URL, TMemoryStream *sendStream) { receivedStream->Clear(); HTTPClient->URL = URL; HTTPClient->SendStream = sendStream; aborted = false; reallyDone = false; try { HTTPClient->PostASync(); // sync } catch(Exception &e) { } while(!reallyDone) // for SSL to work well! Forms::Application->ProcessMessages(); } void __fastcall RequestDone(TObject *Sender, THttpRequest RqType, WORD ErrCode) { delete HTTPClient->SendStream; HTTPClient->SendStream = NULL; PostMessage(HandleToPost, WM_ADMIN_HTTP_POST_DONE, ErrCode, 0); } void __fastcall finalizeRequest(WORD ErrCode) { if(ErrCode) adminClient->HTTPClientHostUnreachable(ErrCode); else if(aborted) adminClient->HTTPClientWaitTimeoutExpired(); else if(HTTPClient->StatusCode != 200) adminClient->HTTPClientOnHTTPError(); else adminClient->HTTPClientDone(receivedStream); reallyDone = true; } }; // and the server adminHTTPSSLServer = new TSslHttpServer(NULL); adminHTTPSSLServer->OnGetDocument = HTTPServerGetDocument; adminHTTPSSLServer->OnHeadDocument = HTTPServerHeadDocument; adminHTTPSSLServer->OnPostDocument = HTTPServerPostDocument; adminHTTPSSLServer->OnPostedData = HTTPServerPostedData; adminHTTPSSLServer->OnClientConnect = HTTPServerClientConnected; adminHTTPSSLServer->OnClientDisconnect = HTTPServerClientDisconnected; adminHTTPSSLServer->OnHttpRequestDone = HTTPServerClientRequestDone; adminHTTPSSLServer->MaxClients = 50; adminHTTPSSLServer->ListenBacklog = 200; adminHTTPSSLContext = new TSslContext(NULL); adminHTTPSSLContext->SslVerifyPeer = false; adminHTTPSSLContext->SslOptions << sslOpt_MICROSOFT_SESS_ID_BUG << sslOpt_NETSCAPE_CHALLENGE_BUG << sslOpt_NETSCAPE_REUSE_CIPHER_CHANGE_BUG << sslOpt_SSLREF2_REUSE_CERT_TYPE_BUG << sslOpt_MICROSOFT_BIG_SSLV3_BUFFER << sslOpt_SSLEAY_080_CLIENT_DH_BUG << sslOpt_TLS_D5_BUG << sslOpt_TLS_BLOCK_PADDING_BUG, sslOpt_TLS_ROLLBACK_BUG << sslOpt_NO_SSLv2 << sslOpt_NETSCAPE_CA_DN_BUG << sslOpt_NETSCAPE_DEMO_CIPHER_CHANGE_BUG; adminHTTPSSLContext->SslVerifyPeerModes << SslVerifyMode_PEER; adminHTTPSSLContext->SslSessionCacheModes = TSslSessCacheModes() << sslSESS_CACHE_NO_INTERNAL_LOOKUP << sslSESS_CACHE_NO_INTERNAL_STORE; adminHTTPSSLContext->SslCipherList = "ALL:!ADH:!DES:RC4+RSA:@STRENGTH"; adminHTTPSSLContext->SslVersionMethod = sslV23_SERVER; adminHTTPSSLContext->SslSessionTimeout = 300; adminHTTPSSLContext->SslSessionCacheSize = 20480; adminHTTPSSLContext->SslDefaultSessionIDContext = "IQP_ADMIN_SERVER"; ... void __fastcall AdminServer::HTTPServerGetDocument(TObject *Sender, TObject *Client, Overbyteicshttpsrv::THttpGetFlag &Flags) { Flags = hg403; } //--------------------------------------------------------------------------- void __fastcall AdminServer::HTTPServerHeadDocument(TObject *Sender, TObject *Client, Overbyteicshttpsrv::THttpGetFlag &Flags) { Flags = hg403; } //--------------------------------------------------------------------------- void __fastcall AdminServer::HTTPServerPostDocument(TObject *Sender, TObject *Client, Overbyteicshttpsrv::THttpGetFlag &Flags) { THttpConnection *httpClient = (THttpConnection*)Client; httpClient->LineMode = false; httpClient->KeepAlive = false; forceRestart = false; if(httpClient->RequestContentLength <= 4 * 1024 * 1024) Flags = hgAcceptData; } //--------------------------------------------------------------------------- void __fastcall AdminServer::HTTPServerPostedData(TObject *Sender, TObject *Client, WORD ErrCode) { THttpConnection *httpClient = (THttpConnection*)Client; AdminServerConnectionData *connectionData = (AdminServerConnectionData*)(void*)httpClient->Tag; if(ErrCode) httpClient->Abort(); else { int Len = httpClient->Receive((void*)connectionData->buffer, 16384); if(Len <= 0) return; if(connectionData->docSize + Len > httpClient->RequestContentLength) { connectionData->stream->Write((void*)connectionData->buffer, httpClient->RequestContentLength - connectionData->docSize); connectionData->docSize = httpClient->RequestContentLength; } else { connectionData->stream->Write((void*)connectionData->buffer, Len); connectionData->docSize += Len; } if(httpClient->RequestContentLength <= connectionData->docSize) { connectionData->stream->Seek(0, 0); TMemoryStream *responseXML = processRequest(connectionData->stream, httpClient); Overbyteicshttpsrv::THttpGetFlag Flags; httpClient->DocStream = responseXML; httpClient->AnswerStream(Flags, "", "application/xml", ""); } } } //--------------------------------------------------------------------------- void __fastcall AdminServer::HTTPServerClientRequestDone(TObject *Sender, TObject *Client) { Overbyteicshttpsrv::THttpConnection *httpClient = (Overbyteicshttpsrv::THttpConnection*)Client; httpClient->PostedDataReceived(); if(newIP.Length() || newPort.Length() || forceRestart) PostMessage(serverContainerObject->handle, WM_RESTART_ADMIN_SERVER, 0, 0); } //--------------------------------------------------------------------------- void __fastcall AdminServer::HTTPServerClientConnected(TObject *Sender, TObject *Client, WORD Error) { THttpConnection *httpClient = (THttpConnection*)Client; httpClient->Tag = (int)(void*)new AdminServerConnectionData(); } //--------------------------------------------------------------------------- void __fastcall AdminServer::HTTPServerClientDisconnected(TObject *Sender, TObject *Client, WORD Error) { THttpConnection *httpClient = (THttpConnection*)Client; AdminServerConnectionData *connectionData = (AdminServerConnectionData*)(void*)httpClient->Tag; delete connectionData; httpClient->Tag = 0; } //--------------------------------------------------------------------------- No matter what I did, it still gives 10053 after 10-20 requests. Any help? Regards, SZ -- To unsubscribe or change your settings for TWSocket mailing list please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket Visit our website at http://www.overbyte.be