@@ -1570,15 +1570,15 @@ TEST_F(TCPv4Tests, secure_non_blocking_send)
15701570
15711571 // Prepare the message
15721572 asio::error_code ec;
1573- std::vector<octet> message (msg_size * 2 , 0 );
1573+ std::vector<octet> message (msg_size, 0 );
15741574 const octet* data = message.data ();
15751575 size_t size = message.size ();
15761576 NetworkBuffer buffers (data, size);
15771577 std::vector<NetworkBuffer> buffer_list;
15781578 buffer_list.push_back (buffers);
15791579
1580- // Send the message with no header. Since TCP actually allocates twice the size of the buffer requested
1581- // it should be able to send a message of msg_size*2 .
1580+ // Send the message with no header. Since TCP actually allocates about twice the size of the buffer requested, and
1581+ // since the threshold to discard (sendBufferSize) is set to msg_size, it should be able to send a message of msg_size.
15821582 size_t bytes_sent = sender_channel_resource->send (nullptr , 0 , buffer_list, size, ec);
15831583 ASSERT_EQ (bytes_sent, size);
15841584
@@ -1589,8 +1589,9 @@ TEST_F(TCPv4Tests, secure_non_blocking_send)
15891589 ASSERT_EQ (ec, asio::error_code ());
15901590 ASSERT_EQ (bytes_read, size);
15911591
1592- // Now try to send a message that is bigger than the buffer size: (msg_size*2 + 1) + bytes_in_send_buffer(0) > 2*sendBufferSize
1593- message.resize (msg_size * 2 + 1 );
1592+ // Now try to send a message whose size surpasses the threshold to discard (sendBufferSize):
1593+ // (msg_size + 1) + bytes_in_send_buffer(0) > sendBufferSize
1594+ message.resize (msg_size + 1 );
15941595 data = message.data ();
15951596 size = message.size ();
15961597 buffer_list.clear ();
@@ -2108,15 +2109,15 @@ TEST_F(TCPv4Tests, non_blocking_send)
21082109
21092110 // Prepare the message
21102111 asio::error_code ec;
2111- std::vector<octet> message (msg_size * 2 , 0 );
2112+ std::vector<octet> message (msg_size, 0 );
21122113 const octet* data = message.data ();
21132114 size_t size = message.size ();
21142115 NetworkBuffer buffers (data, size);
21152116 std::vector<NetworkBuffer> buffer_list;
21162117 buffer_list.push_back (buffers);
21172118
2118- // Send the message with no header. Since TCP actually allocates twice the size of the buffer requested
2119- // it should be able to send a message of msg_size*2 .
2119+ // Send the message with no header. Since TCP actually allocates about twice the size of the buffer requested, and
2120+ // since the threshold to discard (sendBufferSize) is set to msg_size, it should be able to send a message of msg_size.
21202121 size_t bytes_sent = sender_channel_resource->send (nullptr , 0 , buffer_list, size, ec);
21212122 ASSERT_EQ (bytes_sent, size);
21222123
@@ -2125,8 +2126,9 @@ TEST_F(TCPv4Tests, non_blocking_send)
21252126 size_t bytes_read = asio::read (socket, asio::buffer (buffer, size), asio::transfer_exactly (size), ec);
21262127 ASSERT_EQ (bytes_read, size);
21272128
2128- // Now try to send a message that is bigger than the buffer size: (msg_size*2 + 1) + bytes_in_send_buffer(0) > 2*sendBufferSize
2129- message.resize (msg_size * 2 + 1 );
2129+ // Now try to send a message whose size surpasses the threshold to discard (sendBufferSize):
2130+ // (msg_size + 1) + bytes_in_send_buffer(0) > sendBufferSize
2131+ message.resize (msg_size + 1 );
21302132 data = message.data ();
21312133 size = message.size ();
21322134 buffer_list.clear ();
0 commit comments