aboutsummaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-11-16 18:48:40 +0000
committerChristian Grothoff <christian@grothoff.org>2013-11-16 18:48:40 +0000
commit942c00a499e9fd77a7573de622d169f362b08abd (patch)
treead568654df2e9dda3c9427d834f6f573d9d883ce /src/conversation
parent16d4890cc9745833cd1542d5ec4391b7e4f87c71 (diff)
downloadgnunet-942c00a499e9fd77a7573de622d169f362b08abd.tar.gz
gnunet-942c00a499e9fd77a7573de622d169f362b08abd.zip
-fix missing endianess conversions
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/gnunet-conversation.c16
-rw-r--r--src/conversation/gnunet-service-conversation.c10
2 files changed, 15 insertions, 11 deletions
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c
index 07cb8ac44..2ea3d77cb 100644
--- a/src/conversation/gnunet-conversation.c
+++ b/src/conversation/gnunet-conversation.c
@@ -332,6 +332,7 @@ start_phone ()
332 phone_state = PS_LOOKUP_EGO; 332 phone_state = PS_LOOKUP_EGO;
333 return; 333 return;
334 } 334 }
335 GNUNET_assert (NULL == phone);
335 phone = GNUNET_CONVERSATION_phone_create (cfg, 336 phone = GNUNET_CONVERSATION_phone_create (cfg,
336 caller_id, 337 caller_id,
337 &phone_event_handler, NULL); 338 &phone_event_handler, NULL);
@@ -374,10 +375,9 @@ call_event_handler (void *cls,
374 { 375 {
375 case GNUNET_CONVERSATION_EC_CALL_RINGING: 376 case GNUNET_CONVERSATION_EC_CALL_RINGING:
376 GNUNET_break (CS_RESOLVING == call_state); 377 GNUNET_break (CS_RESOLVING == call_state);
377 if (verbose) 378 FPRINTF (stdout,
378 FPRINTF (stdout, 379 _("Resolved address of `%s'. Now ringing other party.\n"),
379 "%s", 380 peer_name);
380 _("Resolved address. Now ringing other party.\n"));
381 call_state = CS_RINGING; 381 call_state = CS_RINGING;
382 break; 382 break;
383 case GNUNET_CONVERSATION_EC_CALL_PICKED_UP: 383 case GNUNET_CONVERSATION_EC_CALL_PICKED_UP:
@@ -524,6 +524,7 @@ do_call (const char *arg)
524 GNUNET_free_non_null (peer_name); 524 GNUNET_free_non_null (peer_name);
525 peer_name = GNUNET_strdup (arg); 525 peer_name = GNUNET_strdup (arg);
526 call_state = CS_RESOLVING; 526 call_state = CS_RESOLVING;
527 GNUNET_assert (NULL == call);
527 call = GNUNET_CONVERSATION_call_start (cfg, 528 call = GNUNET_CONVERSATION_call_start (cfg,
528 caller_id, 529 caller_id,
529 arg, 530 arg,
@@ -1011,8 +1012,6 @@ do_stop_task (void *cls,
1011 mic = NULL; 1012 mic = NULL;
1012 GNUNET_free (ego_name); 1013 GNUNET_free (ego_name);
1013 ego_name = NULL; 1014 ego_name = NULL;
1014 GNUNET_CONFIGURATION_destroy (cfg);
1015 cfg = NULL;
1016 GNUNET_free_non_null (peer_name); 1015 GNUNET_free_non_null (peer_name);
1017 phone_state = PS_ERROR; 1016 phone_state = PS_ERROR;
1018} 1017}
@@ -1175,6 +1174,11 @@ main (int argc, char *const *argv)
1175 gettext_noop ("Enables having a conversation with other GNUnet users."), 1174 gettext_noop ("Enables having a conversation with other GNUnet users."),
1176 options, &run, NULL); 1175 options, &run, NULL);
1177 GNUNET_free ((void *) argv); 1176 GNUNET_free ((void *) argv);
1177 if (NULL != cfg)
1178 {
1179 GNUNET_CONFIGURATION_destroy (cfg);
1180 cfg = NULL;
1181 }
1178 return (GNUNET_OK == ret) ? 0 : 1; 1182 return (GNUNET_OK == ret) ? 0 : 1;
1179} 1183}
1180 1184
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index b12d0e193..7fbff1fac 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -978,7 +978,7 @@ handle_mesh_hangup_message (void *cls,
978 } 978 }
979 line = ch->line; 979 line = ch->line;
980 *channel_ctx = NULL; 980 *channel_ctx = NULL;
981 hup.header.size = sizeof (hup); 981 hup.header.size = htons (sizeof (hup));
982 hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); 982 hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
983 hup.cid = ch->cid; 983 hup.cid = ch->cid;
984 status = ch->status; 984 status = ch->status;
@@ -1057,7 +1057,7 @@ handle_mesh_pickup_message (void *cls,
1057 mq_done_finish_caller_shutdown (ch); 1057 mq_done_finish_caller_shutdown (ch);
1058 return GNUNET_SYSERR; 1058 return GNUNET_SYSERR;
1059 } 1059 }
1060 pick.header.size = sizeof (pick); 1060 pick.header.size = htons (sizeof (pick));
1061 pick.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP); 1061 pick.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP);
1062 pick.cid = ch->cid; 1062 pick.cid = ch->cid;
1063 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1063 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -1107,7 +1107,7 @@ handle_mesh_suspend_message (void *cls,
1107 return GNUNET_SYSERR; 1107 return GNUNET_SYSERR;
1108 } 1108 }
1109 line = ch->line; 1109 line = ch->line;
1110 suspend.header.size = sizeof (suspend); 1110 suspend.header.size = htons (sizeof (suspend));
1111 suspend.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND); 1111 suspend.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_SUSPEND);
1112 suspend.cid = ch->cid; 1112 suspend.cid = ch->cid;
1113 GNUNET_MESH_receive_done (channel); 1113 GNUNET_MESH_receive_done (channel);
@@ -1165,7 +1165,7 @@ handle_mesh_resume_message (void *cls,
1165 return GNUNET_SYSERR; 1165 return GNUNET_SYSERR;
1166 } 1166 }
1167 line = ch->line; 1167 line = ch->line;
1168 resume.header.size = sizeof (resume); 1168 resume.header.size = htons (sizeof (resume));
1169 resume.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME); 1169 resume.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RESUME);
1170 resume.cid = ch->cid; 1170 resume.cid = ch->cid;
1171 GNUNET_MESH_receive_done (channel); 1171 GNUNET_MESH_receive_done (channel);
@@ -1341,7 +1341,7 @@ inbound_end (void *cls,
1341 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1341 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1342 "Mesh channel destroyed by mesh in state %d\n", 1342 "Mesh channel destroyed by mesh in state %d\n",
1343 ch->status); 1343 ch->status);
1344 hup.header.size = sizeof (hup); 1344 hup.header.size = htons (sizeof (hup));
1345 hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP); 1345 hup.header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP);
1346 hup.cid = ch->cid; 1346 hup.cid = ch->cid;
1347 switch (ch->status) 1347 switch (ch->status)