From 080514d45a21cc1d7f6dcc441514d52b71bc77a7 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Sat, 18 Apr 2020 12:17:24 +0200 Subject: [PATCH] Remove redundant check for endpoint GUID in SEDP The conversion of incoming discovery data (in "parameter list" format) check for the presence of the entity GUID parameter for the particular type of endpoint and use it as the key field in subsequent processing. If the parameter is absent, deserialisation fails and the handlers are never called and the old check is therefore no longer necessary. Signed-off-by: Erik Boasson --- src/core/ddsi/src/q_ddsi_discovery.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/core/ddsi/src/q_ddsi_discovery.c b/src/core/ddsi/src/q_ddsi_discovery.c index df4f133..1bc06c4 100644 --- a/src/core/ddsi/src/q_ddsi_discovery.c +++ b/src/core/ddsi/src/q_ddsi_discovery.c @@ -1162,9 +1162,7 @@ static void handle_SEDP_alive (const struct receiver_state *rst, seqno_t seq, dd #endif assert (datap); - - if (!(datap->present & PP_ENDPOINT_GUID)) - E (" no guid?\n", err); + assert (datap->present & PP_ENDPOINT_GUID); GVLOGDISC (" "PGUIDFMT, PGUID (datap->endpoint_guid)); ppguid.prefix = datap->endpoint_guid.prefix; @@ -1350,11 +1348,7 @@ static void handle_SEDP_dead (const struct receiver_state *rst, ddsi_plist_t *da { struct ddsi_domaingv * const gv = rst->gv; int res; - if (!(datap->present & PP_ENDPOINT_GUID)) - { - GVLOGDISC (" no guid?\n"); - return; - } + assert (datap->present & PP_ENDPOINT_GUID); GVLOGDISC (" "PGUIDFMT, PGUID (datap->endpoint_guid)); if (is_writer_entityid (datap->endpoint_guid.entityid)) res = delete_proxy_writer (gv, &datap->endpoint_guid, timestamp, 0);