Skip to content

Commit 6349f7a

Browse files
authored
Merge pull request #154 from tstenner/downgrade_fix
Fix accidental protocol downgrade
2 parents 9283800 + a571262 commit 6349f7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tcp_server.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,9 @@ void client_session::handle_read_feedparams(
427427
api_config::get_instance()->use_protocol_version(), client_protocol_version);
428428
// downgrade to 1.00 (portable binary format) if an unsupported binary conversion is
429429
// involved
430-
if (serv_->info_->channel_bytes() != client_value_size) data_protocol_version_ = 100;
430+
if (serv_->info_->channel_format() != cft_string &&
431+
serv_->info_->channel_bytes() != client_value_size)
432+
data_protocol_version_ = 100;
431433
if (!format_ieee754[cft_double64] ||
432434
(format == cft_float32 && !format_ieee754[cft_float32]) ||
433435
!client_has_ieee754_floats)

0 commit comments

Comments
 (0)