Skip to content

Commit 5056f40

Browse files
authored
Revert "Add check before deserializing messages (sonic-net#812)" (sonic-net#819)
This reverts commit 2365fe8. Will be creating new PR to solve issue with proper RC instead of simply dropping message.
1 parent 91677eb commit 5056f40

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

common/events_common.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,7 @@ struct serialization
258258
int
259259
deserialize(const string& s, Map& data)
260260
{
261-
if (s.size() < 2) { // zmq identifying message of length 1
262-
return 0;
263-
}
261+
264262
try {
265263
istringstream ss(s);
266264
boost::archive::text_iarchive iarch(ss);

tests/events_common_ut.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,17 @@ TEST(events_common, send_recv)
8181
void *sock_p1 = zmq_socket (zmq_ctx, ZMQ_PAIR);
8282
EXPECT_EQ(0, zmq_bind (sock_p1, path));
8383

84-
string source("Hello"), source1, source2("#");
84+
string source("Hello"), source1;
8585

8686
map<string, string> m = {{"foo", "bar"}, {"hello", "world"}, {"good", "day"}};
87-
map<string, string> m1, m2;
87+
map<string, string> m1;
8888

8989
EXPECT_EQ(0, zmq_message_send(sock_p0, source, m));
9090

9191
EXPECT_EQ(0, zmq_message_read(sock_p1, 0, source1, m1));
9292

9393
EXPECT_EQ(source, source1);
9494
EXPECT_EQ(m, m1);
95-
96-
EXPECT_EQ(0, deserialize(source2, m2));
97-
9895
zmq_close(sock_p0);
9996
zmq_close(sock_p1);
10097
zmq_ctx_term(zmq_ctx);

0 commit comments

Comments
 (0)