aboutsummaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-10-05 19:09:11 +0000
committerChristian Grothoff <christian@grothoff.org>2013-10-05 19:09:11 +0000
commit4843271ab090b187d41fd8cb8e96a1b829e91e7c (patch)
treec2d69a551b2566c4ade66d41938e046feec767d4 /src/conversation
parentb474e8accaae339632954c808e05cfda2087f2fe (diff)
downloadgnunet-4843271ab090b187d41fd8cb8e96a1b829e91e7c.tar.gz
gnunet-4843271ab090b187d41fd8cb8e96a1b829e91e7c.zip
-fix mesh tunnel destruction
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/gnunet-service-conversation.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c
index 982e188d5..c051dfde0 100644
--- a/src/conversation/gnunet-service-conversation.c
+++ b/src/conversation/gnunet-service-conversation.c
@@ -585,6 +585,11 @@ handle_client_audio_message (void *cls,
585 switch (line->status) 585 switch (line->status)
586 { 586 {
587 case LS_CALLEE_LISTEN: 587 case LS_CALLEE_LISTEN:
588 /* could be OK if the line just was closed by the other side */
589 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
590 "Audio data dropped, channel is down\n");
591 GNUNET_SERVER_receive_done (client, GNUNET_OK);
592 break;
588 case LS_CALLEE_RINGING: 593 case LS_CALLEE_RINGING:
589 case LS_CALLER_CALLING: 594 case LS_CALLER_CALLING:
590 GNUNET_break (0); 595 GNUNET_break (0);
@@ -596,14 +601,14 @@ handle_client_audio_message (void *cls,
596 break; 601 break;
597 case LS_CALLEE_SHUTDOWN: 602 case LS_CALLEE_SHUTDOWN:
598 case LS_CALLER_SHUTDOWN: 603 case LS_CALLER_SHUTDOWN:
599 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 604 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG | GNUNET_ERROR_TYPE_BULK,
600 "Mesh audio channel in shutdown; audio data dropped\n"); 605 "Mesh audio channel in shutdown; audio data dropped\n");
601 GNUNET_SERVER_receive_done (client, GNUNET_OK); 606 GNUNET_SERVER_receive_done (client, GNUNET_OK);
602 return; 607 return;
603 } 608 }
604 if (NULL == line->tunnel_unreliable) 609 if (NULL == line->tunnel_unreliable)
605 { 610 {
606 GNUNET_log (GNUNET_ERROR_TYPE_INFO, 611 GNUNET_log (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK,
607 _("Mesh audio channel not ready; audio data dropped\n")); 612 _("Mesh audio channel not ready; audio data dropped\n"));
608 GNUNET_SERVER_receive_done (client, GNUNET_OK); 613 GNUNET_SERVER_receive_done (client, GNUNET_OK);
609 return; 614 return;
@@ -612,10 +617,12 @@ handle_client_audio_message (void *cls,
612 { 617 {
613 /* NOTE: we may want to not do this and instead combine the data */ 618 /* NOTE: we may want to not do this and instead combine the data */
614 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 619 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
615 "Dropping previous audio data segment with %u bytes\n", 620 "Bandwidth insufficient; dropping previous audio data segment with %u bytes\n",
616 line->audio_size); 621 (unsigned int) line->audio_size);
617 GNUNET_MESH_notify_transmit_ready_cancel (line->unreliable_mth); 622 GNUNET_MESH_notify_transmit_ready_cancel (line->unreliable_mth);
623 line->unreliable_mth = NULL;
618 GNUNET_free (line->audio_data); 624 GNUNET_free (line->audio_data);
625 line->audio_data = NULL;
619 } 626 }
620 line->audio_size = size; 627 line->audio_size = size;
621 line->audio_data = GNUNET_malloc (line->audio_size); 628 line->audio_data = GNUNET_malloc (line->audio_size);
@@ -1067,12 +1074,18 @@ inbound_end (void *cls,
1067 return; 1074 return;
1068 if (line->tunnel_unreliable == tunnel) 1075 if (line->tunnel_unreliable == tunnel)
1069 { 1076 {
1077 if (NULL != line->unreliable_mth)
1078 {
1079 GNUNET_MESH_notify_transmit_ready_cancel (line->unreliable_mth);
1080 line->unreliable_mth = NULL;
1081 }
1070 line->tunnel_unreliable = NULL; 1082 line->tunnel_unreliable = NULL;
1071 return; 1083 return;
1072 } 1084 }
1073 if (line->tunnel_reliable != tunnel) 1085 if (line->tunnel_reliable != tunnel)
1074 return; 1086 return;
1075 line->tunnel_reliable = NULL; 1087 line->tunnel_reliable = NULL;
1088
1076 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 1089 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
1077 "Mesh tunnel destroyed by mesh\n"); 1090 "Mesh tunnel destroyed by mesh\n");
1078 hup.header.size = sizeof (hup); 1091 hup.header.size = sizeof (hup);
@@ -1081,7 +1094,7 @@ inbound_end (void *cls,
1081 { 1094 {
1082 case LS_CALLEE_LISTEN: 1095 case LS_CALLEE_LISTEN:
1083 GNUNET_break (0); 1096 GNUNET_break (0);
1084 return; 1097 break;
1085 case LS_CALLEE_RINGING: 1098 case LS_CALLEE_RINGING:
1086 case LS_CALLEE_CONNECTED: 1099 case LS_CALLEE_CONNECTED:
1087 GNUNET_SERVER_notification_context_unicast (nc, 1100 GNUNET_SERVER_notification_context_unicast (nc,
@@ -1092,7 +1105,6 @@ inbound_end (void *cls,
1092 break; 1105 break;
1093 case LS_CALLEE_SHUTDOWN: 1106 case LS_CALLEE_SHUTDOWN:
1094 line->status = LS_CALLEE_LISTEN; 1107 line->status = LS_CALLEE_LISTEN;
1095 destroy_line_mesh_tunnels (line);
1096 break; 1108 break;
1097 case LS_CALLER_CALLING: 1109 case LS_CALLER_CALLING:
1098 case LS_CALLER_CONNECTED: 1110 case LS_CALLER_CONNECTED:
@@ -1100,12 +1112,11 @@ inbound_end (void *cls,
1100 line->client, 1112 line->client,
1101 &hup.header, 1113 &hup.header,
1102 GNUNET_NO); 1114 GNUNET_NO);
1103 destroy_line_mesh_tunnels (line);
1104 break; 1115 break;
1105 case LS_CALLER_SHUTDOWN: 1116 case LS_CALLER_SHUTDOWN:
1106 destroy_line_mesh_tunnels (line);
1107 break; 1117 break;
1108 } 1118 }
1119 destroy_line_mesh_tunnels (line);
1109} 1120}
1110 1121
1111 1122