summaryrefslogtreecommitdiff
path: root/gr-blocks/lib/tcp_connection.cc
diff options
context:
space:
mode:
authorJacob Gilbert <jacob.gilbert@sandia.gov>2016-02-08 07:36:01 -0800
committerJohnathan Corgan <johnathan@corganlabs.com>2016-02-08 07:42:11 -0800
commit0f9bab7c0e46e029cbe1864cfd766dc7a80897ef (patch)
tree6e9b1f1cb919789bdc2794473c1e2f7effba39f0 /gr-blocks/lib/tcp_connection.cc
parent1e232b237e210be17ad635b53a78017cd6778a75 (diff)
blocks: fix incorrect use of items/bytes in PDU handling
For a uniform vector, calls to pmt::length return the number of items in in the vector. However, in some places this was being treated as a byte value, resulting in short writes and other misinterpretations. These calls have been replaced with calls to pmt::blob_length, to unambiguously get the length in bytes, then converted if necessary to item values.
Diffstat (limited to 'gr-blocks/lib/tcp_connection.cc')
-rw-r--r--gr-blocks/lib/tcp_connection.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gr-blocks/lib/tcp_connection.cc b/gr-blocks/lib/tcp_connection.cc
index 27bdf6a57d..3b0afa13fc 100644
--- a/gr-blocks/lib/tcp_connection.cc
+++ b/gr-blocks/lib/tcp_connection.cc
@@ -53,7 +53,7 @@ namespace gr {
void
tcp_connection::send(pmt::pmt_t vector)
{
- size_t len = pmt::length(vector);
+ size_t len = pmt::blob_length(vector);
size_t offset = 0;
std::vector<char> txbuf(std::min(len, d_buf.size()));
while (offset < len) {