Added debugging messages

This commit is contained in:
jmjatlanta 2017-08-16 07:33:43 -05:00
parent 365e645d94
commit 4e9cfd7bd5

View file

@ -28,8 +28,9 @@ const struct Libp2pProtocolHandler* protocol_compare(const unsigned char* incomi
*/
int libp2p_protocol_marshal(const unsigned char* incoming, size_t incoming_size, struct SessionContext* session, struct Libp2pVector* handlers) {
const struct Libp2pProtocolHandler* handler = protocol_compare(incoming, incoming_size, handlers);
if (handler != NULL) {
return handler->HandleMessage(incoming, incoming_size, session, handler->context);
if (handler == NULL) {
libp2p_logger_error("protocol", "Unable to find handler.\n");
return -1;
}
return -1;
return handler->HandleMessage(incoming, incoming_size, session, handler->context);
}