Skip to content

Commit

Permalink
Low: clientlib: add more logging
Browse files Browse the repository at this point in the history
Several warning messages and some debug messages.
  • Loading branch information
dmuhamedagic committed Apr 20, 2018
1 parent 16af0ba commit 6b3734c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions clientlib/fsqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ _fsqueue_enq(FsQueue* self ///< us - the FsQueue we're operating on
, FrameSet* fs) ///< The @ref FrameSet to enqueue into our queue - must NOT have sequence#
{
SeqnoFrame* seqno;
char *destaddr;
DEBUGMSG3("%s.%d: inserting fs %p: ref count = %d", __FUNCTION__, __LINE__, fs, fs->baseclass._refcount);
// This FrameSet shouldn't have a sequence number frame yet...
g_return_val_if_fail(fs->_seqframe == NULL, FALSE);
Expand All @@ -83,6 +84,10 @@ _fsqueue_enq(FsQueue* self ///< us - the FsQueue we're operating on
frameset_prepend_frame(fs, &seqno->baseclass);
// And put this FrameSet at the end of the queue
g_queue_push_tail(self->_q, fs);
destaddr = self->_destaddr->baseclass.toString(&self->_destaddr->baseclass);
DEBUGMSG3("%s.%d: queued frameset fstype=%d seqno="FMT_64BIT"d (dest=%s)", __FUNCTION__, __LINE__,
fs->fstype, self->_nextseqno-1, destaddr);
g_free(destaddr); destaddr = NULL;

// Now do all the paperwork :-D
// We need for the FrameSet to be kept around for potentially a long time...
Expand Down
6 changes: 6 additions & 0 deletions clientlib/packetdecoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ _decode_packet_framedata_to_frameobject(PacketDecoder* self, ///<[in/out] Packet
ret = unknownframe_tlvconstructor(*pktstart, *pktend, newpacket, &newpacketend);
}
if (NULL == ret) {
g_warning("%s.%d: tlv contructor for frametype %d failed"
, __FUNCTION__, __LINE__, frametype);
return NULL;
}
g_return_val_if_fail(ret != NULL, NULL);
Expand Down Expand Up @@ -247,6 +249,8 @@ _pktdata_to_framesetlist(PacketDecoder*self, ///<[in] PacketDecoder object
newframestart = newpacket;
}
if (NULL == newframe) {
g_warning("%s.%d: conversion from framedata to frameobject in frameset %d failed"
, __FUNCTION__, __LINE__, fs->fstype);
UNREF(fs);
goto errout;
}
Expand Down Expand Up @@ -275,6 +279,8 @@ _pktdata_to_framesetlist(PacketDecoder*self, ///<[in] PacketDecoder object
}
if (fs) {
ret = g_slist_append(ret, fs); fs = NULL;
} else {
g_warning("%s.%d: no frameset found", __FUNCTION__, __LINE__);
}
curframeset = nextframeset;
}
Expand Down

0 comments on commit 6b3734c

Please sign in to comment.