[twsocket] Problem Posting in OverbyteIcsSslWebServ Sample

2016-01-04 Thread Darin McGee
Hi -

I am using the sample program OverbyteIcsSslWebServ sample program and I am 
experiencing a problem trying to "post" data to the web server. I am using the 
sample program unaltered.  I created the missing html file that performs the 
actual posting to the web server from the comments listed before the 
SslHttpServer1PostDocument procedure in the OverbyteIcsSslWebServ1.pas file.  I 
also created my own self signed SHA256 / 2048 Bit certs and that all works well.

When I fill in the first and last names and click the button to submit (post) 
the data, the program throws an exception ( Access violation at address 
004B34E8 in module OverbyteIcsSslWebServ.exe Write of address 0026 ) and 
the debugger line breaks on Remote.FPostedDataBuffer[Remote.FDataLen] := #0; 
within the procedure TSslWebServForm.SslHttpServer1PostedData.

I have tried this on two different Windows 7 machines, Delphi 7, ICS version 
8.18 with the same results.

I am at a complete lost and any help in getting this sample to run would be 
greatly appreciated.

Darin
-- 
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


Re: [twsocket] Problem Posting in OverbyteIcsSslWebServ Sample

2016-01-04 Thread Darin McGee
Thank you RTT, that did the trick however fixing that seems to have exposed
yet another problem in the code.  I will post later with what I find.

Thanks again!


-Original Message-
From: TWSocket [mailto:twsocket-boun...@lists.elists.org] On Behalf Of RTT
Sent: Monday, January 04, 2016 3:10 PM
To: ICS support mailing 
Subject: Re: [twsocket] Problem Posting in OverbyteIcsSslWebServ Sample


> When I fill in the first and last names and click the button to submit
(post) the data, the program throws an exception ( Access violation at
address 004B34E8 in module OverbyteIcsSslWebServ.exe Write of address
0026 ) and the debugger line breaks on
Remote.FPostedDataBuffer[Remote.FDataLen] := #0; within the procedure
TSslWebServForm.SslHttpServer1PostedData.

Change the line
Remote.FPostedDataBuffer[Remote.FDataLen] := #0; to
Remote.FPostedRawData[Remote.FDataLen] := #0;
--
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


Re: [twsocket] Problem changing LineEnd before full buffer reading

2016-01-04 Thread Dod
Hello,

OK not a big deal now I know it's a bug and not a bad usage on my side, I can 
manage it.

Thanx.

>> I am in front of a strange behavior and would like to know if it is
>> because of a misuse or a bug (using ICS V8 WSocket)
>>
R> Probably a bug in the unit OverbyteIcsWSocket?

R> function TCustomLineWSocket.TriggerDataAvailable(ErrCode : Word) : Boolean;
R> ...
R> else begin
R>  Move(PAnsiChar(FRcvdPtr)[I + Length(FLineEnd)], 
R> PAnsiChar(FRcvdPtr)[0],
R>   FRcvdCnt - I - Length(FLineEnd));
R>  FRcvdCnt := FRcvdCnt - I - Length(FLineEnd);
R>  end;

R> This code is moving the not yet processed data to the beginning of the
R> buffer, so it can search for the next line in the remaining received 
R> data, after triggering the client OnDataAvailable (for the current found
R> line) where you change the FLineEnd, so, if the FLineEnd length changes,
R> it picks the wrong already processed data end.



  mailto:do...@yahoo.com

-- 
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


Re: [twsocket] Problem changing LineEnd before full buffer reading

2016-01-04 Thread RTT



I am in front of a strange behavior and would like to know if it is
because of a misuse or a bug (using ICS V8 WSocket)


Probably a bug in the unit OverbyteIcsWSocket?

function TCustomLineWSocket.TriggerDataAvailable(ErrCode : Word) : Boolean;
...
else begin
Move(PAnsiChar(FRcvdPtr)[I + Length(FLineEnd)], 
PAnsiChar(FRcvdPtr)[0],

 FRcvdCnt - I - Length(FLineEnd));
FRcvdCnt := FRcvdCnt - I - Length(FLineEnd);
end;

This code is moving the not yet processed data to the beginning of the 
buffer, so it can search for the next line in the remaining received 
data, after triggering the client OnDataAvailable (for the current found 
line) where you change the FLineEnd, so, if the FLineEnd length changes, 
it picks the wrong already processed data end.


--
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


Re: [twsocket] HTTPCLI for WebSocket connection ?

2016-01-04 Thread Dod
Hello,

First of all, happy new year to all ICS lovers ;-)

Well  I  think  I  said  victory  too  soon,  in  fact the socket stay
connected  but  no event is triggered by ICS, OnDataPush, OnDataPush2,
OnDocData,  OnDocBegin,  none  of  them triggers, sniffing the network
show data reception from websocket server.

The  stream  is  a  flow  of  JSON  stuctures  (each  block of JSON is
preceeded  by an 8 bytes binary block), there is no CRLF at all inside
JSON or between packs.

I  know  it's  difficult to answer that from an external point of view
but any idea why no event is triggered ?

regards.

>> I am attempting THttpCli adding specific HTTTP Headers to see it works

ARMSL> There are THttpCli events for sent and received headers, into which you 
can add your
ARMSL> extra Upgrade:, etc, headers, and check if they are received.  

ARMSL> This should be easy enough for testing, once there is a list of the 
actual
ARMSL> headers used both ways, they could be added to the real component, but 
ideally we
ARMSL> need a server to test against. 

ARMSL> Not sure what happens after the upgrade handshake, presumably the 
traffic continues
ARMSL> on the same socket but bypassing the HTTP protocol.   That might be fun 
to
ARMSL> implement...

ARMSL> Angus




  mailto:do...@yahoo.com

-- 
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