From: Jaewook Jung Date: Wed, 28 Sep 2016 01:40:45 +0000 (+0900) Subject: annotate OIC_LOG_BUFFER when looking for client callback and observer X-Git-Tag: 1.3.0~1057^2~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce6822710a2ee2272b2740e6747f219c8c51dfca;p=platform%2Fupstream%2Fiotivity.git annotate OIC_LOG_BUFFER when looking for client callback and observer Printing all token info while looking for client callback or observer is burden and makes it hard to see entire log message even though it is needless. Change-Id: I25e0c3f1922f207a9d6652017495270db34e6bbc Signed-off-by: Jaewook Jung Reviewed-on: https://gerrit.iotivity.org/gerrit/12375 Tested-by: jenkins-iotivity Reviewed-by: Ashok Babu Channa --- diff --git a/resource/csdk/stack/src/occlientcb.c b/resource/csdk/stack/src/occlientcb.c index 6f1a702..319871a 100644 --- a/resource/csdk/stack/src/occlientcb.c +++ b/resource/csdk/stack/src/occlientcb.c @@ -225,13 +225,13 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength, { OIC_LOG (INFO, TAG, "Looking for token"); OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength); - OIC_LOG(INFO, TAG, "\tFound in callback list"); LL_FOREACH(cbList, out) { - OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength); - + /* de-annotate below line if want to see all token in cbList */ + //OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength); if (memcmp(out->token, token, tokenLength) == 0) { + OIC_LOG(INFO, TAG, "Found in callback list"); return out; } CheckAndDeleteTimedOutCB(out); @@ -239,10 +239,12 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength, } else if (handle) { + OIC_LOG (INFO, TAG, "Looking for handle"); LL_FOREACH(cbList, out) { if (out->handle == handle) { + OIC_LOG(INFO, TAG, "Found in callback list"); return out; } CheckAndDeleteTimedOutCB(out); @@ -253,9 +255,11 @@ ClientCB* GetClientCB(const CAToken_t token, uint8_t tokenLength, OIC_LOG_V(INFO, TAG, "Looking for uri %s", requestUri); LL_FOREACH(cbList, out) { - OIC_LOG_V(INFO, TAG, "\tFound %s", out->requestUri); + /* de-annotate below line if want to see all uri in cbList */ + //OIC_LOG_V(INFO, TAG, "%s", out->requestUri); if (out->requestUri && strcmp(out->requestUri, requestUri ) == 0) { + OIC_LOG(INFO, TAG, "Found in callback list"); return out; } CheckAndDeleteTimedOutCB(out); diff --git a/resource/csdk/stack/src/ocobserve.c b/resource/csdk/stack/src/ocobserve.c index 3e0a9ba..ea8fea9 100644 --- a/resource/csdk/stack/src/ocobserve.c +++ b/resource/csdk/stack/src/ocobserve.c @@ -445,19 +445,19 @@ ResourceObserver* GetObserverUsingId (const OCObservationId observeId) ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLength) { - ResourceObserver *out = NULL; - if (token) { OIC_LOG(INFO, TAG, "Looking for token"); OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)token, tokenLength); - OIC_LOG(INFO, TAG, "\tFound token:"); + ResourceObserver *out = NULL; LL_FOREACH (g_serverObsList, out) { - OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength); + /* de-annotate below line if want to see all token in cbList */ + //OIC_LOG_BUFFER(INFO, TAG, (const uint8_t *)out->token, tokenLength); if ((memcmp(out->token, token, tokenLength) == 0)) { + OIC_LOG(INFO, TAG, "Found in observer list"); return out; } }