Hi all,

I've met a problem I don't understand. I have 10+ year old application
developed in D2007 with code receiving data from one socket and sending
this data to another socket using SSL (OpenSSL) in separate thread created when accepting connection on listening port on Win10.

As I can remember, we used the application years ago in 7x24 mode
and I'd say a problem did not occur at that time.

The code is called in the loop and in the principle looks like:

      ...
      ReqLng := AInpSocket.WaitingData;
      if AInpSocket.LastError<>0 then
        begin
          Result := ECHO_WAIT_DATA_ERROR;
          exit;
        end;
      if ReqLng=0 then
        begin
          Result := ECHO_NO_DATA_PENDING;
          exit;
        end
      else if ReqLng<0 then
        begin
          Result := -maxint;
          exit;
        end
      else // ReqLng>0
        begin
          if (ReqLng > length(FBuffer)) then
            _AdjustBuffer(ReqLng);
          RcvLng := AInpSocket.RecvBuffer(addr(FBuffer[1]),ReqLng);
          if AInpSocket.LastError<>0 then
            begin
              Result := ECHO_RECV_DATA_ERROR;
              exit;
            end;
            ...
            ...

WaitingData() returns e.g. 932 bytes, but consecutive RecvBuffer() reads
1 byte only and that situation repeats, see log fragment:

        [C>>S]  [CNT]  "1" bytes echoed
        [C>>S]  [CNT]  "548" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "1208" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "502" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "361" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "382" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "333" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "33" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "381" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "346" bytes echoed
        [C<<S]  [CNT]  "1" bytes echoed
        [C<<S]  [CNT]  "384" bytes echoed

I tried almost everything (latest Synapse snapshot, newer openssl library, various SSLTypes...), but behavour is stil the same.

Does anobody has an idea, what could be wrong?



Thx, pf




_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to