Commit a4114d06 authored by Niels Möller's avatar Niels Möller
Browse files

(channel_data_handler,

channel_extended_data_handler):
Use lsh_string_trunc.

Rev: src/channel.c:1.114
parent daff509c
......@@ -1208,7 +1208,7 @@ DEFINE_PACKET_HANDLER(static, channel_data_handler,
if (data->length > channel->rec_max_packet)
{
werror("Channel data larger than rec_max_packet. Extra data ignored.\n");
data->length = channel->rec_max_packet;
lsh_string_trunc(data, channel->rec_max_packet);
}
if (data->length > channel->rec_window_size)
......@@ -1218,7 +1218,7 @@ DEFINE_PACKET_HANDLER(static, channel_data_handler,
debug(" (data->length=%i, rec_window_size=%i).\n",
data->length, channel->rec_window_size);
data->length = channel->rec_window_size;
lsh_string_trunc(data, channel->rec_window_size);
}
if (!data->length)
......@@ -1279,7 +1279,7 @@ DEFINE_PACKET_HANDLER(static, channel_extended_data_handler,
if (data->length > channel->rec_max_packet)
{
werror("Channel data larger than rec_max_packet. Extra data ignored.\n");
data->length = channel->rec_max_packet;
lsh_string_trunc(data, channel->rec_max_packet);
}
if (data->length > channel->rec_window_size)
......@@ -1289,7 +1289,8 @@ DEFINE_PACKET_HANDLER(static, channel_extended_data_handler,
"Extra data ignored.\n");
debug(" (data->length=%i, rec_window_size=%i).\n",
data->length, channel->rec_window_size);
data->length = channel->rec_window_size;
lsh_string_trunc(data, channel->rec_window_size);
}
if (!data->length)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment