[prev in list] [next in list] [prev in thread] [next in thread] 

List:       twsocket
Subject:    Re: [twsocket] HTTP Client POST under WinXPSP3 issue
From:       Fastream Technologies <gates () fastream ! com>
Date:       2011-08-16 7:52:00
Message-ID: CADmY-SdjjJK7sJAnUS=udQY9g0ebn7Z5tKyYorbmtCfo9NhVnQ () mail ! gmail ! com
[Download RAW message or body]

Basically this is my code. It works on Win7/2008 for POST as well as for
GET/HEAD (which return just 403) but under XPSP3 GET/HEAD still works from
browser but the POST fails. Just returns nothing--as if it is aborted. I do
not have debugger on the XP machine but one thing very strange is it works
when the engine (server) is in debug exe but not when it is as service. The
service is optimized code. So I am clueless right now.

void __fastcall AdminServer::HTTPServerPostDocument(TObject *Sender, TObject
*Client, Overbyteicshttpsrv::THttpGetFlag &Flags)
{
 THttpConnection *httpClient = (THttpConnection*)Client;
 AdminServerConnectionData *connectionData =
(AdminServerConnectionData*)(void*)httpClient->Tag;
 connectionData->docSize = 0;
 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->PostedDataReceived();
  httpClient->Abort();
 }
 else
 {
  int Len = httpClient->Receive((void*)connectionData->buffer, 8192);
  if(Len <= 0)
   return;
  connectionData->stream->Write((void*)connectionData->buffer, Len);
  connectionData->docSize += Len;

  if(connectionData->docSize >= httpClient->RequestContentLength)
  {
   httpClient->PostedDataReceived();
   connectionData->stream->Seek(0, 0);
   TMemoryStream *responseXML = processRequest(connectionData->stream,
httpClient);
   Overbyteicshttpsrv::THttpGetFlag Flags;
   httpClient->DocStream = responseXML;
   httpClient->SendStream();
  }
 }
}
//---------------------------------------------------------------------------

Best Regards,

SZ

On Tue, Aug 16, 2011 at 10:42, Fastream Technologies <gates@fastream.com>wrote:

> No, it must be with THttpServer on very fast (say local) connections. With
> Wireshark I can see the data does not reach the client and it timeouts.
>
> Regards,
>
> SZ
> On Mon, Aug 15, 2011 at 12:49, Fastream Technologies <gates@fastream.com>wrote:
>
>> I think you are right. However there is an issue in my code in service
>> application mode. I believe it should be something related with Windows
>> account permissions but not sure...
>>
>> Regards,
>>
>> SZ
>> On Mon, Aug 15, 2011 at 12:22, Angus Robertson - Magenta Systems Ltd <
>> angus@magsys.co.uk> wrote:
>>
>>> > We have an important issue with HTTPClient: Only under WinXP, when
>>> > I POST
>>> > data to an ICS server, it returns StatusCode = 0 and empty
>>> > RcvdStream! Has anybody seen this behavior before?
>>>
>>> No, my public web site is using the latest ICS v7 snapshot and POST works
>>> fine from Windows XP with MSIE and Firefox, try the page at:
>>>
>>> http://www.telecom-tariffs.co.uk/codelook.htm
>>>
>>> Angus
>>>
>>> --
>>> 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
>>>
>>
>>
>
--
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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic