gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31414 - gnunet/src/conversation


From: gnunet
Subject: [GNUnet-SVN] r31414 - gnunet/src/conversation
Date: Mon, 16 Dec 2013 16:13:51 +0100

Author: harsha
Date: 2013-12-16 16:13:51 +0100 (Mon, 16 Dec 2013)
New Revision: 31414

Modified:
   gnunet/src/conversation/gnunet-service-conversation.c
Log:
- debug
- htonl source line number while calling
- do not select a suspended channel upon receiving the first audio message


Modified: gnunet/src/conversation/gnunet-service-conversation.c
===================================================================
--- gnunet/src/conversation/gnunet-service-conversation.c       2013-12-16 
14:10:20 UTC (rev 31413)
+++ gnunet/src/conversation/gnunet-service-conversation.c       2013-12-16 
15:13:51 UTC (rev 31414)
@@ -713,7 +713,7 @@
   GNUNET_CRYPTO_ecdsa_key_get_public (&msg->caller_id,
                                       &ring->caller_id);
   ring->remote_line = msg->line;
-  ring->source_line = line->local_line;
+  ring->source_line = htonl (line->local_line);
   ring->target = msg->target;
   ring->source = my_identity;
   ring->expiration_time = GNUNET_TIME_absolute_hton 
(GNUNET_TIME_relative_to_absolute (RING_TIMEOUT));
@@ -757,8 +757,8 @@
   GNUNET_free (ch->audio_data);
   ch->audio_data = NULL;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Sending %u bytes of audio data on line %u via mesh\n",
-              ch->audio_size, ch->remote_line);
+              "Sending %u bytes of audio data from line %u to remote line %u 
via mesh\n",
+              ch->audio_size, ch->line->local_line, ch->remote_line);
   return sizeof (struct MeshAudioMessage) + ch->audio_size;
 }
 
@@ -819,6 +819,12 @@
     GNUNET_SERVER_receive_done (client, GNUNET_OK);
     return;
   }
+  if (GNUNET_YES == ch->suspended_local)
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "This channel is suspended 
locally\n");
+    GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
+    return;
+  }
   if (NULL == ch->channel_unreliable)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK,
@@ -942,7 +948,8 @@
   cring.cid = ch->cid;
   cring.caller_id = msg->caller_id;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Sending RING message to client\n");
+              "Sending RING message to client. CID %u:(%u, %u)\n", 
+              ch->cid, ch->remote_line, line->local_line);
   GNUNET_SERVER_notification_context_unicast (nc,
                                               line->client,
                                               &cring.header,
@@ -1113,6 +1120,9 @@
   suspend.header.type = htons 
(GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND);
   suspend.cid = ch->cid;
   GNUNET_MESH_receive_done (channel);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Suspending channel CID: %u(%u:%u)\n",
+              ch->cid, ch->remote_line, line->local_line);
   switch (ch->status)
   {
   case CS_CALLEE_RINGING:
@@ -1252,20 +1262,36 @@
                (NULL == ch->channel_unreliable) )
             break;
         }
+        break;
       }
+    if (NULL == line)
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Received %u bytes of AUDIO data for non-existing line %u, 
dropping.\n",
+                  msize, ntohl (msg->remote_line));
+      return GNUNET_SYSERR;
+    }
     if (NULL == ch)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Received AUDIO data for non-existing line %u, dropping.\n",
-                  ntohl (msg->remote_line));
+                  "Received %u bytes of AUDIO data for unknown sender.\n",
+                  msize);
       return GNUNET_SYSERR;
     }
+    if ((GNUNET_YES == ch->suspended_local) || (GNUNET_YES == 
ch->suspended_remote))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+                  "Received %u bytes of AUDIO data on suspended channel CID 
%u:(%u:%u); dropping\n",
+                  msize, ch->cid, ch->remote_line, line->local_line);
+      return GNUNET_OK;
+    }
     ch->channel_unreliable = channel;
     *channel_ctx = ch;
   }
+  GNUNET_break (ch->line->local_line == ntohl (msg->remote_line));
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-              "Forwarding %u bytes of AUDIO data to client\n",
-              msize);
+              "Forwarding %u bytes of AUDIO data to client CID %u:(%u:%u)\n",
+              msize, ch->cid, ch->remote_line, ch->line->local_line);
   cam = (struct ClientAudioMessage *) buf;
   cam->header.size = htons (sizeof (buf));
   cam->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]