gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r30755 - gnunet/src/conversation
Date: Sat, 16 Nov 2013 19:48:40 +0100

Author: grothoff
Date: 2013-11-16 19:48:40 +0100 (Sat, 16 Nov 2013)
New Revision: 30755

Modified:
   gnunet/src/conversation/gnunet-conversation.c
   gnunet/src/conversation/gnunet-service-conversation.c
Log:
-fix missing endianess conversions

Modified: gnunet/src/conversation/gnunet-conversation.c
===================================================================
--- gnunet/src/conversation/gnunet-conversation.c       2013-11-16 18:30:45 UTC 
(rev 30754)
+++ gnunet/src/conversation/gnunet-conversation.c       2013-11-16 18:48:40 UTC 
(rev 30755)
@@ -332,6 +332,7 @@
     phone_state = PS_LOOKUP_EGO;
     return;
   }
+  GNUNET_assert (NULL == phone);
   phone = GNUNET_CONVERSATION_phone_create (cfg,
                                             caller_id,
                                             &phone_event_handler, NULL);
@@ -374,10 +375,9 @@
   {
   case GNUNET_CONVERSATION_EC_CALL_RINGING:
     GNUNET_break (CS_RESOLVING == call_state);
-    if (verbose)
-      FPRINTF (stdout,
-               "%s",
-               _("Resolved address. Now ringing other party.\n"));
+    FPRINTF (stdout,
+             _("Resolved address of `%s'. Now ringing other party.\n"),
+             peer_name);
     call_state = CS_RINGING;
     break;
   case GNUNET_CONVERSATION_EC_CALL_PICKED_UP:
@@ -524,6 +524,7 @@
   GNUNET_free_non_null (peer_name);
   peer_name = GNUNET_strdup (arg);
   call_state = CS_RESOLVING;
+  GNUNET_assert (NULL == call);
   call = GNUNET_CONVERSATION_call_start (cfg,
                                          caller_id,
                                          arg,
@@ -1011,8 +1012,6 @@
   mic = NULL;
   GNUNET_free (ego_name);
   ego_name = NULL;
-  GNUNET_CONFIGURATION_destroy (cfg);
-  cfg = NULL;
   GNUNET_free_non_null (peer_name);
   phone_state = PS_ERROR;
 }
@@ -1175,6 +1174,11 @@
                            gettext_noop ("Enables having a conversation with 
other GNUnet users."),
                            options, &run, NULL);
   GNUNET_free ((void *) argv);
+  if (NULL != cfg)
+  {
+    GNUNET_CONFIGURATION_destroy (cfg);
+    cfg = NULL;
+  }
   return (GNUNET_OK == ret) ? 0 : 1;
 }
 

Modified: gnunet/src/conversation/gnunet-service-conversation.c
===================================================================
--- gnunet/src/conversation/gnunet-service-conversation.c       2013-11-16 
18:30:45 UTC (rev 30754)
+++ gnunet/src/conversation/gnunet-service-conversation.c       2013-11-16 
18:48:40 UTC (rev 30755)
@@ -978,7 +978,7 @@
   }
   line = ch->line;
   *channel_ctx = NULL;
-  hup.header.size = sizeof (hup);
+  hup.header.size = htons (sizeof (hup));
   hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
   hup.cid = ch->cid;
   status = ch->status;
@@ -1057,7 +1057,7 @@
     mq_done_finish_caller_shutdown (ch);
     return GNUNET_SYSERR;
   }
-  pick.header.size = sizeof (pick);
+  pick.header.size = htons (sizeof (pick));
   pick.header.type = htons 
(GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP);
   pick.cid = ch->cid;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1107,7 +1107,7 @@
     return GNUNET_SYSERR;
   }
   line = ch->line;
-  suspend.header.size = sizeof (suspend);
+  suspend.header.size = htons (sizeof (suspend));
   suspend.header.type = htons 
(GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND);
   suspend.cid = ch->cid;
   GNUNET_MESH_receive_done (channel);
@@ -1165,7 +1165,7 @@
     return GNUNET_SYSERR;
   }
   line = ch->line;
-  resume.header.size = sizeof (resume);
+  resume.header.size = htons (sizeof (resume));
   resume.header.type = htons 
(GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME);
   resume.cid = ch->cid;
   GNUNET_MESH_receive_done (channel);
@@ -1341,7 +1341,7 @@
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Mesh channel destroyed by mesh in state %d\n",
               ch->status);
-  hup.header.size = sizeof (hup);
+  hup.header.size = htons (sizeof (hup));
   hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
   hup.cid = ch->cid;
   switch (ch->status)




reply via email to

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