Skip to content

Commit db94f76

Browse files
committed
Rewritten to avoid including header from examples
1 parent df9c118 commit db94f76

11 files changed

Lines changed: 213 additions & 193 deletions

File tree

TAO/tests/GIOP_Fragments/Big_String_Sequence/.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ server_log.txt
77
client_log.txt
88
client
99
server
10-
client_log.txt
11-
server_log.txt

TAO/tests/GIOP_Fragments/Big_String_Sequence/echo.mpc renamed to TAO/tests/GIOP_Fragments/Big_String_Sequence/Big_String_Sequence.mpc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ project(*idl): taoidldefaults {
66
custom_only = 1
77
}
88

9-
project(*Server): taoserver, namingexe, iortable, utils {
9+
project(*Server): taoserver {
1010
exename = server
1111
after += *idl
1212
Source_Files {
1313
Echo_i.cpp
14-
../../../examples/Simple/Simple_util.cpp
1514
server.cpp
1615
EchoS.cpp
1716
EchoC.cpp
@@ -20,12 +19,10 @@ project(*Server): taoserver, namingexe, iortable, utils {
2019
}
2120
}
2221

23-
project(*Client): taoclient, namingexe, iortable, utils {
22+
project(*Client): taoclient {
2423
exename = client
2524
after += *IDL
2625
Source_Files {
27-
Echo_Client_i.cpp
28-
../../../examples/Simple/Simple_util.cpp
2926
client.cpp
3027
EchoC.cpp
3128
}

TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo.idl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ interface Echo
66
{
77
// = TITLE
88
// Defines an interface that encapsulates an operation that returns
9-
// a string sequence.
9+
// a string sequence, or a wstring sequence, respectively.
1010

1111
typedef sequence<string> List;
12+
typedef sequence<wstring> WList;
1213

1314
List return_list ();
15+
WList return_wlist ();
1416

1517
oneway void shutdown ();
1618
};

TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_Client_i.cpp

Lines changed: 0 additions & 78 deletions
This file was deleted.

TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_Client_i.h

Lines changed: 0 additions & 34 deletions
This file was deleted.

TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.cpp

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,17 @@
33

44
// Constructor.
55

6-
Echo_i::Echo_i (void)
6+
Echo_i::Echo_i (CORBA::ORB_ptr o)
7+
: orb_(o)
78
{
89
}
910

1011
// Destructor.
1112

12-
Echo_i::~Echo_i (void)
13+
Echo_i::~Echo_i ()
1314
{
1415
}
1516

16-
// Set the ORB pointer.
17-
18-
void
19-
Echo_i::orb (CORBA::ORB_ptr o)
20-
{
21-
this->orb_ = CORBA::ORB::_duplicate (o);
22-
}
23-
2417
// Return a list of strings.
2518

2619
Echo::List *
@@ -33,22 +26,44 @@ Echo_i::return_list ()
3326
ACE_NEW_RETURN (tmp,
3427
Echo::List (2),
3528
0);
36-
// Pass ownership to the _var, pitty that ACE_NEW_RETURN cannot
37-
// assign to T_vars directly.
3829
list = tmp;
3930
}
4031

4132
list->length (2);
4233

4334
// Just do something to get a 'big' list of strings.
44-
std::string big(4 * 1024 * 1024, 'A');
35+
std::string big(4 * 1024, 'A');
4536
std::string small("Hello World");
4637
list[CORBA::ULong(0)] = CORBA::string_dup(big.c_str());
4738
list[CORBA::ULong(1)] = CORBA::string_dup(small.c_str());
4839

4940
return list._retn ();
5041
}
5142

43+
Echo::WList *
44+
Echo_i::return_wlist ()
45+
{
46+
Echo::WList_var list;
47+
48+
{
49+
Echo::WList *tmp = 0;
50+
ACE_NEW_RETURN (tmp,
51+
Echo::WList (2),
52+
0);
53+
list = tmp;
54+
}
55+
56+
list->length (2);
57+
58+
// Just do something to get a 'big' list of wide strings.
59+
std::wstring big(4 * 1024, 'A');
60+
std::wstring small(17, 'B');
61+
list[CORBA::ULong(0)] = CORBA::wstring_dup(big.c_str());
62+
list[CORBA::ULong(1)] = CORBA::wstring_dup(small.c_str());
63+
64+
return list._retn ();
65+
}
66+
5267
// Shutdown the server application.
5368

5469
void

TAO/tests/GIOP_Fragments/Big_String_Sequence/Echo_i.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*
77
* This class implements the Echo IDL interface.
88
*
9-
* @author Kirthika Parameswaran <kirthika@cs.wustl.edu>
109
*/
1110
//=============================================================================
1211

@@ -21,29 +20,23 @@
2120
*
2221
* @brief Echo Object Implementation
2322
*
24-
* The object implementation performs the following functions:
25-
* -- To return the string which needs to be displayed
26-
* from the server.
27-
* -- shuts down the server
2823
*/
2924
class Echo_i : public POA_Echo
3025
{
3126
public:
3227
/// Constructor.
33-
Echo_i (void);
28+
Echo_i (CORBA::ORB_ptr o);
3429

3530
/// Destructor.
3631
virtual ~Echo_i (void);
3732

38-
/// Return the mesg string back from the server.
33+
/// Return the result sequences to the cllient.
3934
virtual Echo::List *return_list ();
35+
virtual Echo::WList *return_wlist ();
4036

4137
/// Shutdown the server.
4238
virtual void shutdown ();
4339

44-
/// Set the ORB pointer.
45-
void orb (CORBA::ORB_ptr o);
46-
4740
private:
4841
/// ORB pointer.
4942
CORBA::ORB_var orb_;

TAO/tests/GIOP_Fragments/Big_String_Sequence/README.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,9 @@
22
## Reproduces a bug when GIOP fragmentation is used
33

44
The server returns a string sequence with two elements, the first is a
5-
long 4MB string with repeating character 'A', the second element is
5+
long 4kB string with repeating character 'A', the second element is
66
the string "Hello World". If one removes the command line parameters
7-
`-ORBMaxMessageSize 1048576` from `run_test.pl` everything
7+
`-ORBMaxMessageSize 1024` from `run_test.pl` everything
88
works as expected, but with these settings, which cause GIOP
99
fragmentation, the client receives an empty string as the second
1010
element of the sequence.
11-
12-
We discovered problems in a more complicated application when big
13-
sequences are returned, often the client encountering
14-
`CORBA::MARSHAL` or `CORBA::COMM_FAILURE` exceptions. In one
15-
case, it worked if the sequence contained a single element, even if
16-
big, but a small second element caused client exceptions. The complex
17-
application encountered problems with big sequences even without the
18-
`-ORBMaxMessageSize` parameter, but problems start at smaller
19-
sizes if it is used.

0 commit comments

Comments
 (0)