Yes, the client sample app has a small issue: you need to reset OTADeltaCount 
to 0 in OnPostedData handler. Sorry if this debug message is confusing, you can 
simply remove and forget it.

I think the problem is THttpConnection.OnConnectionDataSent:
FState is reset to hcRequest before the full post data is read, just after the 
empty line separating the post header from the query string is read.
If I comment the line that reset the FState to hcRequest, everything works 
well. Of course, this might also break the pipelines request feature.

updated code on line +6:
    if not Assigned(FDocStream) then begin
        TriggerAfterAnswer;                   { V7.19 we can log how much data 
was sent from here }
//        if FState in [hcPostedData, hcSendData] then
//            FState := hcRequest;              { ready for next pipelined 
requests } { V8.05 }
        Exit; { no stream usually means just a header string has been sent }
    end;

You can trace that issue in THttpConnection: FMethod is set to the content of 
the query string, which should never happen if I understand correctly the code. 
This is because FState is wrongly reset to hcRequest in the middle of the 
processing, in OnConnectionDataSent, as described above. I dont know why.

Regards,
Laurent



________________________________
 De : François Piette <francois.pie...@skynet.be>
À : 'ICS support mailing' <twsocket@lists.elists.org> 
Envoyé le : Samedi 12 octobre 2013 11h01
Objet : Re: [twsocket] Post data lost
 

Hello Laurent,

As far as I can see, your code is working properly. Client always display
"NNN> Request OK with answer: 20" with NNN being the request number.
Server always display:
PostDocument: NNN
Before answer: PostDocument=NNN PostedData=NNN-1
PostedData: NNN

Having NNN the request number.

It also display "Breakpoint on lost data here!" for all requests except the
first. This is normal behavior of your code since you display this message
if OTADeltaCount is > 1 and you only increment OTADeltaCount global
variable. Btw: You should not use global variable.

I compiled your application using XE5 and ICS-V8 released (not using the
copy of ICS files you sent).

-- 
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com





-----Message d'origine-----
De : TWSocket [mailto:twsocket-boun...@lists.elists.org] De la part de
Laurent Breysse
Envoyé : vendredi 11 octobre 2013 17:18
À : tw >> ICS support mailing
Objet : [twsocket] Post data lost

Hello,
When testing my webservice I saw that POST data could be lost: the
OnPostedData handler of the http server component is never called, despite
the hgAcceptData set in OnPostDocument.
I have reproduced this issue with a simple http server, based on the WebServ
sample The use case: repeated sequential posts sent with a indy client
component, with a basic query string (56 bytes long) Most POST are correctly
handled, but some are simply dropped.

In ICS code, the issue leads to the THttpConnection.ConnectionDataSent
method:
on line 4565 (v8 gold release), FState is reset to hcRequest On the
following line, the comment { no stream usually means just a header string
has been sent } is wrong in this case, a querystring has been sent. FDocSize
equals 0 at this time.
Next, in THttpConnection.ParseRequest, the FMethod is then initialized with
the content of the query string (the above 56 bytes)

I'm new to ICS so I was not able to push further the analysis.
No clue if this a bug, I could simply provide sample code to reproduce the
issue.
Any advise welcome,

Regards,
Laurent
--
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
-- 
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

Reply via email to