[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#532228: marked as done (TCPStream: Does only send one packet, if read from the stream)



Your message dated Fri, 24 Feb 2023 21:24:29 +0000
with message-id <[🔎] E1pVfYL-008G96-GK@fasolo.debian.org>
and subject line Bug#998889: Removed package(s) from unstable
has caused the Debian Bug report #532228,
regarding TCPStream: Does only send one packet, if read from the stream
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
532228: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532228
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libcommoncpp2-dev
Version: 1.7.3-1
Severity: normal


DESCRIPTION

I just disovered, that the class TCPStream does not work as expected.
When you do a "send -- receive -- send" , only one package is sent. The second send is not performed.

When you do a "send -- send" , two packages are sent, as expected.

TESTCASE

Attached are two testcases: test.cpp and test_noreceive.cpp
Compile it with e.g g++ test_noreceive.cpp `ccgnu2-config --flags --libs --includes`

The first does the send -- receive -- send, the second just has commented out the receive line.

To test it, use netcat -l -p 12345 

SAMPLE OUTPUT

tobi@mordor:~/workspace/test$ g++ test.cpp `ccgnu2-config --flags --libs --includes --extlibs `
tobi@mordor:~/workspace/test$ netcat -l -p 12345 &
[1] 2124
tobi@mordor:~/workspace/test$ ./a.out 
{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}
tobi@mordor:~/workspace/test$ g++ test_noreceive.cpp `ccgnu2-config --flags --libs --includes --extlibs `
[1]+  Done                    netcat -l -p 12345
tobi@mordor:~/workspace/test$ netcat -l -p 12345 &
[1] 2151
tobi@mordor:~/workspace/test$ ./a.out 
{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}
{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}
[1]+  Done                    netcat -l -p 12345
tobi@mordor:~/workspace/test$ 

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.29-2-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libcommoncpp2-dev depends on:
ii  libccgnu2-1.7-0        1.7.3-1           A GNU package for creating portabl
ii  libgcrypt11-dev [libgc 1.4.4-2           LGPL Crypto library - development 
ii  libgnutls-dev          2.6.6-1           the GNU TLS library - development 
ii  pkg-config             0.22-1            manage compile and link flags for 
ii  zlib1g-dev             1:1.2.3.3.dfsg-13 compression library - development

libcommoncpp2-dev recommends no packages.

Versions of packages libcommoncpp2-dev suggests:
ii  libcommoncpp2-doc             1.7.3-1    Documentation files for Common C++

-- no debconf information
#include <string>
#include <iostream>
#include <cc++/socket.h>
#include <cc++/address.h>

using namespace std;

int main()
{
        try {
                // Testing TCP resending
                string s;
                string r;
                s = "{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}\n";

                ost::IPV4Host host("127.0.0.1");

                ost::TCPStream stream(host, 12345, 536, true, 3000);

                // Send
                stream << s;
                stream.sync();
                // SLEEP
                sleep(3);
                // if this line is commented out,
                // two pacakges are sent as expected.
                // however, if its commented in, only one packet is *sent*
                // receive
                try {
                  stream >> r;
                }
                catch (...)
                {

                }

                sleep(3);
                // send again
                stream << s;
                stream.sync();

                sleep(3);

        } catch (...) {
                cerr << "TCP/IP Connection Error" << endl;
                return false;
        }

        return 0;
}

#include <string>
#include <iostream>
#include <cc++/socket.h>
#include <cc++/address.h>

using namespace std;

int main()
{
        try {
                // Testing TCP resending
                string s;
                string r;
                s = "{FB;01;66|64:TYP;SWV;BDN;PAC;KHR;PIN;KT0;DDY;KYR;KMT;DMT;KT0;RPL;UDC;IDC;IL1;UL1;TKK;TMI;THR;SYS|1AAD}\n";

                ost::IPV4Host host("127.0.0.1");

                ost::TCPStream stream(host, 12345, 536, true, 3000);

                // Send
                stream << s;
                stream.sync();
                // SLEEP
                sleep(3);
                // if this line is commented out,
                // two pacakges are sent as expected.
                // however, if its commented in, only one packet is *sent*
                // receive
                try {
                  //stream >> r;
                }
                catch (...)
                {

                }

                sleep(3);
                // send again
                stream << s;
                stream.sync();

                sleep(3);

        } catch (...) {
                cerr << "TCP/IP Connection Error" << endl;
                return false;
        }

        return 0;
}


--- End Message ---
--- Begin Message ---
Version: 1.8.1-10+rm

Dear submitter,

as the package libcommoncpp2 has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/998889

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply to: