aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_api.c
diff options
context:
space:
mode:
authorBart Polot <bart.polot+voyager@gmail.com>2017-02-08 17:28:19 +0100
committerBart Polot <bart.polot+voyager@gmail.com>2017-02-08 17:28:19 +0100
commit8508f1ae2108e7b518ae3191b477a2b3b75cd02a (patch)
treeca3a5dc1d3ccb57ce87a4c16c2ef34a1e6505761 /src/cadet/cadet_api.c
parent555b46223bfb15267d459dba1e47e2862715c7ab (diff)
downloadgnunet-8508f1ae2108e7b518ae3191b477a2b3b75cd02a.tar.gz
gnunet-8508f1ae2108e7b518ae3191b477a2b3b75cd02a.zip
- debug, indentation, legibility
Diffstat (limited to 'src/cadet/cadet_api.c')
-rw-r--r--src/cadet/cadet_api.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/cadet/cadet_api.c b/src/cadet/cadet_api.c
index 2de8106a0..f55911afa 100644
--- a/src/cadet/cadet_api.c
+++ b/src/cadet/cadet_api.c
@@ -906,10 +906,10 @@ handle_channel_created (void *cls,
906 /** @deprecated */ 906 /** @deprecated */
907 /* Old style API */ 907 /* Old style API */
908 ch->ctx = port->handler (port->cls, 908 ch->ctx = port->handler (port->cls,
909 ch, 909 ch,
910 &msg->peer, 910 &msg->peer,
911 port->hash, 911 port->hash,
912 ch->options); 912 ch->options);
913 } else { 913 } else {
914 /* MQ API */ 914 /* MQ API */
915 GNUNET_assert (NULL != port->connects); 915 GNUNET_assert (NULL != port->connects);
@@ -1012,6 +1012,7 @@ handle_local_data (void *cls,
1012 const struct GNUNET_CADET_MessageHandler *handler; 1012 const struct GNUNET_CADET_MessageHandler *handler;
1013 struct GNUNET_CADET_Channel *ch; 1013 struct GNUNET_CADET_Channel *ch;
1014 uint16_t type; 1014 uint16_t type;
1015 int fwd;
1015 1016
1016 ch = retrieve_channel (h, 1017 ch = retrieve_channel (h,
1017 message->ccn); 1018 message->ccn);
@@ -1024,16 +1025,19 @@ handle_local_data (void *cls,
1024 1025
1025 payload = (struct GNUNET_MessageHeader *) &message[1]; 1026 payload = (struct GNUNET_MessageHeader *) &message[1];
1026 type = ntohs (payload->type); 1027 type = ntohs (payload->type);
1028 fwd = ntohl (ch->ccn.channel_of_client) >= GNUNET_CADET_LOCAL_CHANNEL_ID_CLI;
1027 LOG (GNUNET_ERROR_TYPE_DEBUG, 1029 LOG (GNUNET_ERROR_TYPE_DEBUG,
1028 "Got a %s data on channel %s [%X] of type %s (%u)\n", 1030 "Got a %s data on channel %s [%X] of type %s (%u)\n",
1029 GC_f2s (ntohl (ch->ccn.channel_of_client) >= 1031 GC_f2s (fwd),
1030 GNUNET_CADET_LOCAL_CHANNEL_ID_CLI),
1031 GNUNET_i2s (GNUNET_PEER_resolve2 (ch->peer)), 1032 GNUNET_i2s (GNUNET_PEER_resolve2 (ch->peer)),
1032 ntohl (message->ccn.channel_of_client), 1033 ntohl (message->ccn.channel_of_client),
1033 GC_m2s (type), 1034 GC_m2s (type),
1034 type); 1035 type);
1035 if (NULL != ch->mq) 1036 if (NULL != ch->mq)
1036 { 1037 {
1038 LOG (GNUNET_ERROR_TYPE_DEBUG,
1039 "injecting msg %s into mq\n",
1040 GC_m2s (ntohs (payload->type)));
1037 GNUNET_MQ_inject_message (ch->mq, payload); 1041 GNUNET_MQ_inject_message (ch->mq, payload);
1038 return; 1042 return;
1039 } 1043 }