diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-06 20:55:28 +0000 |
commit | 61c39c60565b386e0e12ea669556b030e8cd7180 (patch) | |
tree | 59109aeab8297bdc996faca8c4e38ec7426c36cf /src/conversation | |
parent | 780eb09dd8040ecf8649d40ddf8314464e0fc48e (diff) | |
download | gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.tar.gz gnunet-61c39c60565b386e0e12ea669556b030e8cd7180.zip |
-remove trailing whitespace
Diffstat (limited to 'src/conversation')
-rw-r--r-- | src/conversation/conversation.h | 8 | ||||
-rw-r--r-- | src/conversation/conversation_api.c | 56 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation-test.c | 12 | ||||
-rw-r--r-- | src/conversation/gnunet-conversation.c | 58 | ||||
-rw-r--r-- | src/conversation/gnunet-helper-audio-playback.c | 54 | ||||
-rw-r--r-- | src/conversation/gnunet-helper-audio-record.c | 64 | ||||
-rw-r--r-- | src/conversation/gnunet-service-conversation.c | 70 | ||||
-rw-r--r-- | src/conversation/microphone.c | 16 | ||||
-rw-r--r-- | src/conversation/speaker.c | 18 | ||||
-rw-r--r-- | src/conversation/test_conversation_api.c | 2 |
10 files changed, 179 insertions, 179 deletions
diff --git a/src/conversation/conversation.h b/src/conversation/conversation.h index 685d98d16..4b42277a5 100644 --- a/src/conversation/conversation.h +++ b/src/conversation/conversation.h | |||
@@ -116,7 +116,7 @@ struct ClientPhonePickupMessage | |||
116 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP | 116 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICK_UP |
117 | */ | 117 | */ |
118 | struct GNUNET_MessageHeader header; | 118 | struct GNUNET_MessageHeader header; |
119 | 119 | ||
120 | /* followed by variable length 0-terminated string with meta data */ | 120 | /* followed by variable length 0-terminated string with meta data */ |
121 | 121 | ||
122 | }; | 122 | }; |
@@ -132,7 +132,7 @@ struct ClientPhoneHangupMessage | |||
132 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP | 132 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP |
133 | */ | 133 | */ |
134 | struct GNUNET_MessageHeader header; | 134 | struct GNUNET_MessageHeader header; |
135 | 135 | ||
136 | /* followed by variable length 0-terminated string with meta data */ | 136 | /* followed by variable length 0-terminated string with meta data */ |
137 | 137 | ||
138 | }; | 138 | }; |
@@ -190,7 +190,7 @@ struct ClientPhonePickedupMessage | |||
190 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP | 190 | * Type is: #GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP |
191 | */ | 191 | */ |
192 | struct GNUNET_MessageHeader header; | 192 | struct GNUNET_MessageHeader header; |
193 | 193 | ||
194 | /* followed by variable length 0-terminated string with meta data */ | 194 | /* followed by variable length 0-terminated string with meta data */ |
195 | 195 | ||
196 | }; | 196 | }; |
@@ -233,7 +233,7 @@ struct MeshPhoneRingMessage | |||
233 | 233 | ||
234 | /** | 234 | /** |
235 | * When does the signature expire? | 235 | * When does the signature expire? |
236 | */ | 236 | */ |
237 | struct GNUNET_TIME_AbsoluteNBO expiration_time; | 237 | struct GNUNET_TIME_AbsoluteNBO expiration_time; |
238 | 238 | ||
239 | /** | 239 | /** |
diff --git a/src/conversation/conversation_api.c b/src/conversation/conversation_api.c index 11eb2b7e7..6e1cbe3fb 100644 --- a/src/conversation/conversation_api.c +++ b/src/conversation/conversation_api.c | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2013 Christian Grothoff (and other contributing authors) | 3 | (C) 2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with GNUnet; see the file COPYING. If not, write to the |
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
@@ -75,7 +75,7 @@ struct GNUNET_CONVERSATION_Phone | |||
75 | * Our configuration. | 75 | * Our configuration. |
76 | */ | 76 | */ |
77 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 77 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * Handle to talk with CONVERSATION service. | 80 | * Handle to talk with CONVERSATION service. |
81 | */ | 81 | */ |
@@ -103,7 +103,7 @@ struct GNUNET_CONVERSATION_Phone | |||
103 | 103 | ||
104 | /** | 104 | /** |
105 | * Connection to NAMESTORE (for reverse lookup). | 105 | * Connection to NAMESTORE (for reverse lookup). |
106 | */ | 106 | */ |
107 | struct GNUNET_NAMESTORE_Handle *ns; | 107 | struct GNUNET_NAMESTORE_Handle *ns; |
108 | 108 | ||
109 | /** | 109 | /** |
@@ -119,7 +119,7 @@ struct GNUNET_CONVERSATION_Phone | |||
119 | /** | 119 | /** |
120 | * This phone's record. | 120 | * This phone's record. |
121 | */ | 121 | */ |
122 | struct GNUNET_CONVERSATION_PhoneRecord my_record; | 122 | struct GNUNET_CONVERSATION_PhoneRecord my_record; |
123 | 123 | ||
124 | /** | 124 | /** |
125 | * My GNS zone. | 125 | * My GNS zone. |
@@ -316,7 +316,7 @@ handle_phone_audio_message (void *cls, | |||
316 | 316 | ||
317 | 317 | ||
318 | /** | 318 | /** |
319 | * We encountered an error talking with the conversation service. | 319 | * We encountered an error talking with the conversation service. |
320 | * | 320 | * |
321 | * @param cls the `struct GNUNET_CONVERSATION_Phone` | 321 | * @param cls the `struct GNUNET_CONVERSATION_Phone` |
322 | * @param error details about the error | 322 | * @param error details about the error |
@@ -326,7 +326,7 @@ phone_error_handler (void *cls, | |||
326 | enum GNUNET_MQ_Error error) | 326 | enum GNUNET_MQ_Error error) |
327 | { | 327 | { |
328 | struct GNUNET_CONVERSATION_Phone *phone = cls; | 328 | struct GNUNET_CONVERSATION_Phone *phone = cls; |
329 | 329 | ||
330 | GNUNET_break (0); | 330 | GNUNET_break (0); |
331 | FPRINTF (stderr, | 331 | FPRINTF (stderr, |
332 | _("Internal error %d\n"), | 332 | _("Internal error %d\n"), |
@@ -346,15 +346,15 @@ reconnect_phone (struct GNUNET_CONVERSATION_Phone *phone) | |||
346 | static struct GNUNET_MQ_MessageHandler handlers[] = | 346 | static struct GNUNET_MQ_MessageHandler handlers[] = |
347 | { | 347 | { |
348 | { &handle_phone_ring, | 348 | { &handle_phone_ring, |
349 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING, | 349 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_RING, |
350 | sizeof (struct ClientPhoneRingMessage) }, | 350 | sizeof (struct ClientPhoneRingMessage) }, |
351 | { &handle_phone_hangup, | 351 | { &handle_phone_hangup, |
352 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, | 352 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, |
353 | 0 }, | 353 | 0 }, |
354 | { &handle_phone_audio_message, | 354 | { &handle_phone_audio_message, |
355 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, | 355 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, |
356 | 0 }, | 356 | 0 }, |
357 | { NULL, 0, 0 } | 357 | { NULL, 0, 0 } |
358 | }; | 358 | }; |
359 | struct GNUNET_MQ_Envelope *e; | 359 | struct GNUNET_MQ_Envelope *e; |
360 | struct ClientPhoneRegisterMessage *reg; | 360 | struct ClientPhoneRegisterMessage *reg; |
@@ -408,7 +408,7 @@ GNUNET_CONVERSATION_phone_create (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
408 | unsigned long long line; | 408 | unsigned long long line; |
409 | 409 | ||
410 | if (GNUNET_OK != | 410 | if (GNUNET_OK != |
411 | GNUNET_CONFIGURATION_get_value_number (cfg, | 411 | GNUNET_CONFIGURATION_get_value_number (cfg, |
412 | "CONVERSATION", | 412 | "CONVERSATION", |
413 | "LINE", | 413 | "LINE", |
414 | &line)) | 414 | &line)) |
@@ -478,7 +478,7 @@ transmit_phone_audio (void *cls, | |||
478 | struct ClientAudioMessage *am; | 478 | struct ClientAudioMessage *am; |
479 | 479 | ||
480 | GNUNET_assert (PS_ACTIVE == phone->state); | 480 | GNUNET_assert (PS_ACTIVE == phone->state); |
481 | e = GNUNET_MQ_msg_extra (am, | 481 | e = GNUNET_MQ_msg_extra (am, |
482 | data_size, | 482 | data_size, |
483 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO); | 483 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO); |
484 | memcpy (&am[1], data, data_size); | 484 | memcpy (&am[1], data, data_size); |
@@ -487,7 +487,7 @@ transmit_phone_audio (void *cls, | |||
487 | 487 | ||
488 | 488 | ||
489 | /** | 489 | /** |
490 | * Picks up a (ringing) phone. This will connect the speaker | 490 | * Picks up a (ringing) phone. This will connect the speaker |
491 | * to the microphone of the other party, and vice versa. | 491 | * to the microphone of the other party, and vice versa. |
492 | * | 492 | * |
493 | * @param phone phone to pick up | 493 | * @param phone phone to pick up |
@@ -630,7 +630,7 @@ struct GNUNET_CONVERSATION_Call | |||
630 | * Our configuration. | 630 | * Our configuration. |
631 | */ | 631 | */ |
632 | const struct GNUNET_CONFIGURATION_Handle *cfg; | 632 | const struct GNUNET_CONFIGURATION_Handle *cfg; |
633 | 633 | ||
634 | /** | 634 | /** |
635 | * Handle to talk with CONVERSATION service. | 635 | * Handle to talk with CONVERSATION service. |
636 | */ | 636 | */ |
@@ -655,7 +655,7 @@ struct GNUNET_CONVERSATION_Call | |||
655 | * Our microphone. | 655 | * Our microphone. |
656 | */ | 656 | */ |
657 | struct GNUNET_MICROPHONE_Handle *mic; | 657 | struct GNUNET_MICROPHONE_Handle *mic; |
658 | 658 | ||
659 | /** | 659 | /** |
660 | * Function to call with events. | 660 | * Function to call with events. |
661 | */ | 661 | */ |
@@ -673,7 +673,7 @@ struct GNUNET_CONVERSATION_Call | |||
673 | 673 | ||
674 | /** | 674 | /** |
675 | * Connection to GNS (can be NULL). | 675 | * Connection to GNS (can be NULL). |
676 | */ | 676 | */ |
677 | struct GNUNET_GNS_Handle *gns; | 677 | struct GNUNET_GNS_Handle *gns; |
678 | 678 | ||
679 | /** | 679 | /** |
@@ -754,7 +754,7 @@ transmit_call_audio (void *cls, | |||
754 | struct ClientAudioMessage *am; | 754 | struct ClientAudioMessage *am; |
755 | 755 | ||
756 | GNUNET_assert (CS_ACTIVE == call->state); | 756 | GNUNET_assert (CS_ACTIVE == call->state); |
757 | e = GNUNET_MQ_msg_extra (am, | 757 | e = GNUNET_MQ_msg_extra (am, |
758 | data_size, | 758 | data_size, |
759 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO); | 759 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO); |
760 | memcpy (&am[1], data, data_size); | 760 | memcpy (&am[1], data, data_size); |
@@ -782,7 +782,7 @@ handle_call_picked_up (void *cls, | |||
782 | metadata = (const char *) &am[1]; | 782 | metadata = (const char *) &am[1]; |
783 | if ( (0 == size) || | 783 | if ( (0 == size) || |
784 | ('\0' != metadata[size - 1]) ) | 784 | ('\0' != metadata[size - 1]) ) |
785 | metadata = NULL; | 785 | metadata = NULL; |
786 | switch (call->state) | 786 | switch (call->state) |
787 | { | 787 | { |
788 | case CS_LOOKUP: | 788 | case CS_LOOKUP: |
@@ -830,7 +830,7 @@ handle_call_hangup (void *cls, | |||
830 | reason = (const char *) &am[1]; | 830 | reason = (const char *) &am[1]; |
831 | if ( (0 == size) || | 831 | if ( (0 == size) || |
832 | ('\0' != reason[size - 1]) ) | 832 | ('\0' != reason[size - 1]) ) |
833 | reason = NULL; | 833 | reason = NULL; |
834 | switch (call->state) | 834 | switch (call->state) |
835 | { | 835 | { |
836 | case CS_LOOKUP: | 836 | case CS_LOOKUP: |
@@ -900,7 +900,7 @@ handle_call_audio_message (void *cls, | |||
900 | * @param rd_count number of records in @a rd | 900 | * @param rd_count number of records in @a rd |
901 | * @param rd the records in reply | 901 | * @param rd the records in reply |
902 | */ | 902 | */ |
903 | static void | 903 | static void |
904 | handle_gns_response (void *cls, | 904 | handle_gns_response (void *cls, |
905 | uint32_t rd_count, | 905 | uint32_t rd_count, |
906 | const struct GNUNET_NAMESTORE_RecordData *rd) | 906 | const struct GNUNET_NAMESTORE_RecordData *rd) |
@@ -919,7 +919,7 @@ handle_gns_response (void *cls, | |||
919 | { | 919 | { |
920 | GNUNET_break_op (0); | 920 | GNUNET_break_op (0); |
921 | continue; | 921 | continue; |
922 | } | 922 | } |
923 | memcpy (&call->phone_record, | 923 | memcpy (&call->phone_record, |
924 | rd[i].data, | 924 | rd[i].data, |
925 | rd[i].data_size); | 925 | rd[i].data_size); |
@@ -942,7 +942,7 @@ handle_gns_response (void *cls, | |||
942 | 942 | ||
943 | 943 | ||
944 | /** | 944 | /** |
945 | * We encountered an error talking with the conversation service. | 945 | * We encountered an error talking with the conversation service. |
946 | * | 946 | * |
947 | * @param cls the `struct GNUNET_CONVERSATION_Call` | 947 | * @param cls the `struct GNUNET_CONVERSATION_Call` |
948 | * @param error details about the error | 948 | * @param error details about the error |
@@ -972,18 +972,18 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) | |||
972 | static struct GNUNET_MQ_MessageHandler handlers[] = | 972 | static struct GNUNET_MQ_MessageHandler handlers[] = |
973 | { | 973 | { |
974 | { &handle_call_busy, | 974 | { &handle_call_busy, |
975 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_BUSY, | 975 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_BUSY, |
976 | sizeof (struct ClientPhoneBusyMessage) }, | 976 | sizeof (struct ClientPhoneBusyMessage) }, |
977 | { &handle_call_picked_up, | 977 | { &handle_call_picked_up, |
978 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP, | 978 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_PICKED_UP, |
979 | 0 }, | 979 | 0 }, |
980 | { &handle_call_hangup, | 980 | { &handle_call_hangup, |
981 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, | 981 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_PHONE_HANG_UP, |
982 | 0 }, | 982 | 0 }, |
983 | { &handle_call_audio_message, | 983 | { &handle_call_audio_message, |
984 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, | 984 | GNUNET_MESSAGE_TYPE_CONVERSATION_CS_AUDIO, |
985 | 0 }, | 985 | 0 }, |
986 | { NULL, 0, 0 } | 986 | { NULL, 0, 0 } |
987 | }; | 987 | }; |
988 | struct GNUNET_CRYPTO_EccPublicSignKey my_zone; | 988 | struct GNUNET_CRYPTO_EccPublicSignKey my_zone; |
989 | 989 | ||
@@ -1013,7 +1013,7 @@ reconnect_call (struct GNUNET_CONVERSATION_Call *call) | |||
1013 | call->state = CS_LOOKUP; | 1013 | call->state = CS_LOOKUP; |
1014 | GNUNET_IDENTITY_ego_get_public_key (call->caller_id, | 1014 | GNUNET_IDENTITY_ego_get_public_key (call->caller_id, |
1015 | &my_zone); | 1015 | &my_zone); |
1016 | call->gns_lookup = GNUNET_GNS_lookup (call->gns, | 1016 | call->gns_lookup = GNUNET_GNS_lookup (call->gns, |
1017 | call->callee, | 1017 | call->callee, |
1018 | &my_zone, | 1018 | &my_zone, |
1019 | GNUNET_NAMESTORE_TYPE_PHONE, | 1019 | GNUNET_NAMESTORE_TYPE_PHONE, |
diff --git a/src/conversation/gnunet-conversation-test.c b/src/conversation/gnunet-conversation-test.c index 1f44ca1fc..cc831a3ab 100644 --- a/src/conversation/gnunet-conversation-test.c +++ b/src/conversation/gnunet-conversation-test.c | |||
@@ -25,8 +25,8 @@ | |||
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | 27 | #include "gnunet_util_lib.h" |
28 | #include "gnunet_speaker_lib.h" | 28 | #include "gnunet_speaker_lib.h" |
29 | #include "gnunet_microphone_lib.h" | 29 | #include "gnunet_microphone_lib.h" |
30 | 30 | ||
31 | /** | 31 | /** |
32 | * How long do we record before we replay? | 32 | * How long do we record before we replay? |
@@ -117,7 +117,7 @@ do_shutdown (void *cls, | |||
117 | rec); | 117 | rec); |
118 | GNUNET_free (rec); | 118 | GNUNET_free (rec); |
119 | } | 119 | } |
120 | fprintf (stderr, | 120 | fprintf (stderr, |
121 | _("\nEnd of transmission. Have a GNU day.\n")); | 121 | _("\nEnd of transmission. Have a GNU day.\n")); |
122 | } | 122 | } |
123 | 123 | ||
@@ -145,7 +145,7 @@ switch_to_speaker (void *cls, | |||
145 | GNUNET_SCHEDULER_shutdown (); | 145 | GNUNET_SCHEDULER_shutdown (); |
146 | return; | 146 | return; |
147 | } | 147 | } |
148 | fprintf (stderr, | 148 | fprintf (stderr, |
149 | _("\nWe are now playing your recording back. If you can hear it, your audio settings are working...")); | 149 | _("\nWe are now playing your recording back. If you can hear it, your audio settings are working...")); |
150 | for (rec=rec_head; NULL != rec; rec = rec->next) | 150 | for (rec=rec_head; NULL != rec; rec = rec->next) |
151 | { | 151 | { |
@@ -170,7 +170,7 @@ switch_to_speaker (void *cls, | |||
170 | * @param data_size number of bytes in @a data | 170 | * @param data_size number of bytes in @a data |
171 | * @param data audio data to play | 171 | * @param data audio data to play |
172 | */ | 172 | */ |
173 | static void | 173 | static void |
174 | record (void *cls, | 174 | record (void *cls, |
175 | size_t data_size, | 175 | size_t data_size, |
176 | const void *data) | 176 | const void *data) |
@@ -211,7 +211,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
211 | st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 211 | st = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
212 | &do_shutdown, | 212 | &do_shutdown, |
213 | NULL); | 213 | NULL); |
214 | fprintf (stderr, | 214 | fprintf (stderr, |
215 | _("We will now be recording you for %s. After that time, the recording will be played back to you..."), | 215 | _("We will now be recording you for %s. After that time, the recording will be played back to you..."), |
216 | GNUNET_STRINGS_relative_time_to_string (TIMEOUT, GNUNET_YES)); | 216 | GNUNET_STRINGS_relative_time_to_string (TIMEOUT, GNUNET_YES)); |
217 | if (GNUNET_OK != | 217 | if (GNUNET_OK != |
diff --git a/src/conversation/gnunet-conversation.c b/src/conversation/gnunet-conversation.c index ad91d3007..113c10098 100644 --- a/src/conversation/gnunet-conversation.c +++ b/src/conversation/gnunet-conversation.c | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2013 Christian Grothoff (and other contributing authors) | 3 | (C) 2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with GNUnet; see the file COPYING. If not, write to the |
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
@@ -173,7 +173,7 @@ phone_event_handler (void *cls, | |||
173 | ...) | 173 | ...) |
174 | { | 174 | { |
175 | va_list va; | 175 | va_list va; |
176 | 176 | ||
177 | va_start (va, code); | 177 | va_start (va, code); |
178 | switch (code) | 178 | switch (code) |
179 | { | 179 | { |
@@ -268,7 +268,7 @@ call_event_handler (void *cls, | |||
268 | ...) | 268 | ...) |
269 | { | 269 | { |
270 | va_list va; | 270 | va_list va; |
271 | 271 | ||
272 | va_start (va, code); | 272 | va_start (va, code); |
273 | switch (code) | 273 | switch (code) |
274 | { | 274 | { |
@@ -338,7 +338,7 @@ struct VoipCommand | |||
338 | * Command the user needs to enter. | 338 | * Command the user needs to enter. |
339 | */ | 339 | */ |
340 | const char *command; | 340 | const char *command; |
341 | 341 | ||
342 | /** | 342 | /** |
343 | * Function to call on command. | 343 | * Function to call on command. |
344 | */ | 344 | */ |
@@ -380,8 +380,8 @@ do_quit (const char *args) | |||
380 | static void | 380 | static void |
381 | do_unknown (const char *msg) | 381 | do_unknown (const char *msg) |
382 | { | 382 | { |
383 | FPRINTF (stderr, | 383 | FPRINTF (stderr, |
384 | _("Unknown command `%s'\n"), | 384 | _("Unknown command `%s'\n"), |
385 | msg); | 385 | msg); |
386 | } | 386 | } |
387 | 387 | ||
@@ -403,7 +403,7 @@ do_call (const char *arg) | |||
403 | } | 403 | } |
404 | switch (state) | 404 | switch (state) |
405 | { | 405 | { |
406 | case CS_LOOKUP_EGO: | 406 | case CS_LOOKUP_EGO: |
407 | FPRINTF (stderr, | 407 | FPRINTF (stderr, |
408 | _("Ego `%s' not available\n"), | 408 | _("Ego `%s' not available\n"), |
409 | ego_name); | 409 | ego_name); |
@@ -470,7 +470,7 @@ do_accept (const char *args) | |||
470 | { | 470 | { |
471 | switch (state) | 471 | switch (state) |
472 | { | 472 | { |
473 | case CS_LOOKUP_EGO: | 473 | case CS_LOOKUP_EGO: |
474 | case CS_LISTEN: | 474 | case CS_LISTEN: |
475 | case CS_ERROR: | 475 | case CS_ERROR: |
476 | FPRINTF (stderr, | 476 | FPRINTF (stderr, |
@@ -497,7 +497,7 @@ do_accept (const char *args) | |||
497 | return; | 497 | return; |
498 | } | 498 | } |
499 | GNUNET_assert (NULL != phone); | 499 | GNUNET_assert (NULL != phone); |
500 | GNUNET_CONVERSATION_phone_pick_up (phone, | 500 | GNUNET_CONVERSATION_phone_pick_up (phone, |
501 | args, | 501 | args, |
502 | speaker, | 502 | speaker, |
503 | mic); | 503 | mic); |
@@ -536,7 +536,7 @@ do_status (const char *args) | |||
536 | { | 536 | { |
537 | switch (state) | 537 | switch (state) |
538 | { | 538 | { |
539 | case CS_LOOKUP_EGO: | 539 | case CS_LOOKUP_EGO: |
540 | FPRINTF (stdout, | 540 | FPRINTF (stdout, |
541 | _("We are currently trying to locate the private key for the ego `%s'.\n"), | 541 | _("We are currently trying to locate the private key for the ego `%s'.\n"), |
542 | ego_name); | 542 | ego_name); |
@@ -586,7 +586,7 @@ do_reject (const char *args) | |||
586 | { | 586 | { |
587 | switch (state) | 587 | switch (state) |
588 | { | 588 | { |
589 | case CS_LOOKUP_EGO: | 589 | case CS_LOOKUP_EGO: |
590 | case CS_LISTEN: | 590 | case CS_LISTEN: |
591 | case CS_ERROR: | 591 | case CS_ERROR: |
592 | FPRINTF (stderr, | 592 | FPRINTF (stderr, |
@@ -604,7 +604,7 @@ do_reject (const char *args) | |||
604 | if (NULL == call) | 604 | if (NULL == call) |
605 | { | 605 | { |
606 | GNUNET_assert (NULL != phone); | 606 | GNUNET_assert (NULL != phone); |
607 | GNUNET_CONVERSATION_phone_hang_up (phone, | 607 | GNUNET_CONVERSATION_phone_hang_up (phone, |
608 | args); | 608 | args); |
609 | state = CS_LISTEN; | 609 | state = CS_LISTEN; |
610 | } | 610 | } |
@@ -621,9 +621,9 @@ do_reject (const char *args) | |||
621 | * List of supported commands. | 621 | * List of supported commands. |
622 | */ | 622 | */ |
623 | static struct VoipCommand commands[] = { | 623 | static struct VoipCommand commands[] = { |
624 | {"/address", &do_address, | 624 | {"/address", &do_address, |
625 | gettext_noop ("Use `/address' to find out which address this phone should have in GNS")}, | 625 | gettext_noop ("Use `/address' to find out which address this phone should have in GNS")}, |
626 | {"/call", &do_call, | 626 | {"/call", &do_call, |
627 | gettext_noop ("Use `/call USER.gnu' to call USER")}, | 627 | gettext_noop ("Use `/call USER.gnu' to call USER")}, |
628 | {"/accept", &do_accept, | 628 | {"/accept", &do_accept, |
629 | gettext_noop ("Use `/accept MESSAGE' to accept an incoming call")}, | 629 | gettext_noop ("Use `/accept MESSAGE' to accept an incoming call")}, |
@@ -631,11 +631,11 @@ static struct VoipCommand commands[] = { | |||
631 | gettext_noop ("Use `/cancel MESSAGE' to reject or terminate a call")}, | 631 | gettext_noop ("Use `/cancel MESSAGE' to reject or terminate a call")}, |
632 | {"/status", &do_status, | 632 | {"/status", &do_status, |
633 | gettext_noop ("Use `/status' to print status information")}, | 633 | gettext_noop ("Use `/status' to print status information")}, |
634 | {"/quit", &do_quit, | 634 | {"/quit", &do_quit, |
635 | gettext_noop ("Use `/quit' to terminate gnunet-conversation")}, | 635 | gettext_noop ("Use `/quit' to terminate gnunet-conversation")}, |
636 | {"/help", &do_help, | 636 | {"/help", &do_help, |
637 | gettext_noop ("Use `/help command' to get help for a specific command")}, | 637 | gettext_noop ("Use `/help command' to get help for a specific command")}, |
638 | {"", &do_unknown, | 638 | {"", &do_unknown, |
639 | NULL}, | 639 | NULL}, |
640 | {NULL, NULL, NULL}, | 640 | {NULL, NULL, NULL}, |
641 | }; | 641 | }; |
@@ -650,8 +650,8 @@ static void | |||
650 | do_help (const char *args) | 650 | do_help (const char *args) |
651 | { | 651 | { |
652 | unsigned int i; | 652 | unsigned int i; |
653 | 653 | ||
654 | i = 0; | 654 | i = 0; |
655 | while ( (NULL != args) && | 655 | while ( (NULL != args) && |
656 | (0 != strlen (args)) && | 656 | (0 != strlen (args)) && |
657 | (commands[i].Action != &do_help)) | 657 | (commands[i].Action != &do_help)) |
@@ -659,7 +659,7 @@ do_help (const char *args) | |||
659 | if (0 == | 659 | if (0 == |
660 | strncasecmp (&args[1], &commands[i].command[1], strlen (args) - 1)) | 660 | strncasecmp (&args[1], &commands[i].command[1], strlen (args) - 1)) |
661 | { | 661 | { |
662 | FPRINTF (stdout, | 662 | FPRINTF (stdout, |
663 | "%s\n", | 663 | "%s\n", |
664 | gettext (commands[i].helptext)); | 664 | gettext (commands[i].helptext)); |
665 | return; | 665 | return; |
@@ -667,13 +667,13 @@ do_help (const char *args) | |||
667 | i++; | 667 | i++; |
668 | } | 668 | } |
669 | i = 0; | 669 | i = 0; |
670 | FPRINTF (stdout, | 670 | FPRINTF (stdout, |
671 | "%s", | 671 | "%s", |
672 | "Available commands:\n"); | 672 | "Available commands:\n"); |
673 | while (commands[i].Action != &do_help) | 673 | while (commands[i].Action != &do_help) |
674 | { | 674 | { |
675 | FPRINTF (stdout, | 675 | FPRINTF (stdout, |
676 | "%s\n", | 676 | "%s\n", |
677 | gettext (commands[i].command)); | 677 | gettext (commands[i].command)); |
678 | i++; | 678 | i++; |
679 | } | 679 | } |
@@ -710,7 +710,7 @@ do_stop_task (void *cls, | |||
710 | { | 710 | { |
711 | GNUNET_SCHEDULER_cancel (handle_cmd_task); | 711 | GNUNET_SCHEDULER_cancel (handle_cmd_task); |
712 | handle_cmd_task = GNUNET_SCHEDULER_NO_TASK; | 712 | handle_cmd_task = GNUNET_SCHEDULER_NO_TASK; |
713 | } | 713 | } |
714 | if (NULL != id) | 714 | if (NULL != id) |
715 | { | 715 | { |
716 | GNUNET_IDENTITY_disconnect (id); | 716 | GNUNET_IDENTITY_disconnect (id); |
@@ -799,7 +799,7 @@ identity_cb (void *cls, | |||
799 | ego_name)) | 799 | ego_name)) |
800 | return; | 800 | return; |
801 | if (NULL == ego) | 801 | if (NULL == ego) |
802 | { | 802 | { |
803 | if (verbose) | 803 | if (verbose) |
804 | FPRINTF (stdout, | 804 | FPRINTF (stdout, |
805 | _("Our ego `%s' was deleted!\n"), | 805 | _("Our ego `%s' was deleted!\n"), |
@@ -826,7 +826,7 @@ identity_cb (void *cls, | |||
826 | */ | 826 | */ |
827 | static void | 827 | static void |
828 | run (void *cls, | 828 | run (void *cls, |
829 | char *const *args, | 829 | char *const *args, |
830 | const char *cfgfile, | 830 | const char *cfgfile, |
831 | const struct GNUNET_CONFIGURATION_Handle *c) | 831 | const struct GNUNET_CONFIGURATION_Handle *c) |
832 | { | 832 | { |
@@ -851,7 +851,7 @@ run (void *cls, | |||
851 | } | 851 | } |
852 | 852 | ||
853 | 853 | ||
854 | /** | 854 | /** |
855 | * The main function to conversation. | 855 | * The main function to conversation. |
856 | * | 856 | * |
857 | * @param argc number of arguments from the command line | 857 | * @param argc number of arguments from the command line |
diff --git a/src/conversation/gnunet-helper-audio-playback.c b/src/conversation/gnunet-helper-audio-playback.c index c0ef217cd..97abd4430 100644 --- a/src/conversation/gnunet-helper-audio-playback.c +++ b/src/conversation/gnunet-helper-audio-playback.c | |||
@@ -102,7 +102,7 @@ static int ready_pipe[2]; | |||
102 | * Message callback | 102 | * Message callback |
103 | */ | 103 | */ |
104 | static int | 104 | static int |
105 | stdin_receiver (void *cls, | 105 | stdin_receiver (void *cls, |
106 | void *client, | 106 | void *client, |
107 | const struct GNUNET_MessageHeader *msg) | 107 | const struct GNUNET_MessageHeader *msg) |
108 | { | 108 | { |
@@ -113,7 +113,7 @@ stdin_receiver (void *cls, | |||
113 | { | 113 | { |
114 | case GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO: | 114 | case GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO: |
115 | audio = (struct AudioMessage *) msg; | 115 | audio = (struct AudioMessage *) msg; |
116 | 116 | ||
117 | ret = opus_decode_float (dec, | 117 | ret = opus_decode_float (dec, |
118 | (const unsigned char *) &audio[1], | 118 | (const unsigned char *) &audio[1], |
119 | ntohs (audio->header.size) - sizeof (struct AudioMessage), | 119 | ntohs (audio->header.size) - sizeof (struct AudioMessage), |
@@ -132,12 +132,12 @@ stdin_receiver (void *cls, | |||
132 | if (pa_stream_write | 132 | if (pa_stream_write |
133 | (stream_out, pcm_buffer, pcm_length, NULL, 0, | 133 | (stream_out, pcm_buffer, pcm_length, NULL, 0, |
134 | PA_SEEK_RELATIVE) < 0) | 134 | PA_SEEK_RELATIVE) < 0) |
135 | { | 135 | { |
136 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 136 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
137 | _("pa_stream_write() failed: %s\n"), | 137 | _("pa_stream_write() failed: %s\n"), |
138 | pa_strerror (pa_context_errno (context))); | 138 | pa_strerror (pa_context_errno (context))); |
139 | return GNUNET_OK; | 139 | return GNUNET_OK; |
140 | } | 140 | } |
141 | break; | 141 | break; |
142 | default: | 142 | default: |
143 | break; | 143 | break; |
@@ -161,8 +161,8 @@ quit (int ret) | |||
161 | * Callback when data is there for playback | 161 | * Callback when data is there for playback |
162 | */ | 162 | */ |
163 | static void | 163 | static void |
164 | stream_write_callback (pa_stream * s, | 164 | stream_write_callback (pa_stream * s, |
165 | size_t length, | 165 | size_t length, |
166 | void *userdata) | 166 | void *userdata) |
167 | { | 167 | { |
168 | /* unblock 'main' */ | 168 | /* unblock 'main' */ |
@@ -192,7 +192,7 @@ exit_signal_callback (pa_mainloop_api * m, pa_signal_event * e, int sig, | |||
192 | * Pulseaudio stream state callback | 192 | * Pulseaudio stream state callback |
193 | */ | 193 | */ |
194 | static void | 194 | static void |
195 | context_state_callback (pa_context * c, | 195 | context_state_callback (pa_context * c, |
196 | void *userdata) | 196 | void *userdata) |
197 | { | 197 | { |
198 | int p; | 198 | int p; |
@@ -203,7 +203,7 @@ context_state_callback (pa_context * c, | |||
203 | case PA_CONTEXT_CONNECTING: | 203 | case PA_CONTEXT_CONNECTING: |
204 | case PA_CONTEXT_AUTHORIZING: | 204 | case PA_CONTEXT_AUTHORIZING: |
205 | case PA_CONTEXT_SETTING_NAME: | 205 | case PA_CONTEXT_SETTING_NAME: |
206 | break; | 206 | break; |
207 | case PA_CONTEXT_READY: | 207 | case PA_CONTEXT_READY: |
208 | { | 208 | { |
209 | GNUNET_assert (!stream_out); | 209 | GNUNET_assert (!stream_out); |
@@ -216,12 +216,12 @@ context_state_callback (pa_context * c, | |||
216 | _("pa_stream_new() failed: %s\n"), | 216 | _("pa_stream_new() failed: %s\n"), |
217 | pa_strerror (pa_context_errno (c))); | 217 | pa_strerror (pa_context_errno (c))); |
218 | goto fail; | 218 | goto fail; |
219 | } | 219 | } |
220 | pa_stream_set_write_callback (stream_out, | 220 | pa_stream_set_write_callback (stream_out, |
221 | &stream_write_callback, | 221 | &stream_write_callback, |
222 | NULL); | 222 | NULL); |
223 | if ((p = | 223 | if ((p = |
224 | pa_stream_connect_playback (stream_out, NULL, | 224 | pa_stream_connect_playback (stream_out, NULL, |
225 | NULL, | 225 | NULL, |
226 | PA_STREAM_ADJUST_LATENCY | PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE, | 226 | PA_STREAM_ADJUST_LATENCY | PA_STREAM_INTERPOLATE_TIMING | PA_STREAM_AUTO_TIMING_UPDATE, |
227 | NULL, NULL)) < 0) | 227 | NULL, NULL)) < 0) |
@@ -232,19 +232,19 @@ context_state_callback (pa_context * c, | |||
232 | goto fail; | 232 | goto fail; |
233 | } | 233 | } |
234 | break; | 234 | break; |
235 | } | 235 | } |
236 | case PA_CONTEXT_TERMINATED: | 236 | case PA_CONTEXT_TERMINATED: |
237 | quit (0); | 237 | quit (0); |
238 | break; | 238 | break; |
239 | 239 | ||
240 | case PA_CONTEXT_FAILED: | 240 | case PA_CONTEXT_FAILED: |
241 | default: | 241 | default: |
242 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 242 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
243 | _("Connection failure: %s\n"), | 243 | _("Connection failure: %s\n"), |
244 | pa_strerror (pa_context_errno (c))); | 244 | pa_strerror (pa_context_errno (c))); |
245 | goto fail; | 245 | goto fail; |
246 | } | 246 | } |
247 | return; | 247 | return; |
248 | fail: | 248 | fail: |
249 | quit (1); | 249 | quit (1); |
250 | } | 250 | } |
@@ -260,13 +260,13 @@ pa_init () | |||
260 | 260 | ||
261 | if (!pa_sample_spec_valid (&sample_spec)) | 261 | if (!pa_sample_spec_valid (&sample_spec)) |
262 | { | 262 | { |
263 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 263 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
264 | _("Wrong Spec\n")); | 264 | _("Wrong Spec\n")); |
265 | } | 265 | } |
266 | /* set up threaded playback mainloop */ | 266 | /* set up threaded playback mainloop */ |
267 | if (!(m = pa_threaded_mainloop_new ())) | 267 | if (!(m = pa_threaded_mainloop_new ())) |
268 | { | 268 | { |
269 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 269 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
270 | _("pa_mainloop_new() failed.\n")); | 270 | _("pa_mainloop_new() failed.\n")); |
271 | } | 271 | } |
272 | mainloop_api = pa_threaded_mainloop_get_api (m); | 272 | mainloop_api = pa_threaded_mainloop_get_api (m); |
@@ -280,9 +280,9 @@ pa_init () | |||
280 | /* connect to the main pulseaudio context */ | 280 | /* connect to the main pulseaudio context */ |
281 | if (!(context = pa_context_new (mainloop_api, "GNUnet VoIP"))) | 281 | if (!(context = pa_context_new (mainloop_api, "GNUnet VoIP"))) |
282 | { | 282 | { |
283 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 283 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
284 | _("pa_context_new() failed.\n")); | 284 | _("pa_context_new() failed.\n")); |
285 | } | 285 | } |
286 | pa_context_set_state_callback (context, context_state_callback, NULL); | 286 | pa_context_set_state_callback (context, context_state_callback, NULL); |
287 | 287 | ||
288 | if (pa_context_connect (context, NULL, 0, NULL) < 0) | 288 | if (pa_context_connect (context, NULL, 0, NULL) < 0) |
@@ -290,10 +290,10 @@ pa_init () | |||
290 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 290 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
291 | _("pa_context_connect() failed: %s\n"), | 291 | _("pa_context_connect() failed: %s\n"), |
292 | pa_strerror (pa_context_errno (context))); | 292 | pa_strerror (pa_context_errno (context))); |
293 | } | 293 | } |
294 | if (pa_threaded_mainloop_start (m) < 0) | 294 | if (pa_threaded_mainloop_start (m) < 0) |
295 | { | 295 | { |
296 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 296 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
297 | _("pa_mainloop_run() failed.\n")); | 297 | _("pa_mainloop_run() failed.\n")); |
298 | } | 298 | } |
299 | } | 299 | } |
@@ -354,7 +354,7 @@ main (int argc, char *argv[]) | |||
354 | ready_pipe[1] = -1; | 354 | ready_pipe[1] = -1; |
355 | while (1) | 355 | while (1) |
356 | { | 356 | { |
357 | ret = read (0, readbuf, sizeof (readbuf)); | 357 | ret = read (0, readbuf, sizeof (readbuf)); |
358 | toff += ret; | 358 | toff += ret; |
359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 359 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
360 | "Received %d bytes of audio data (total: %llu)\n", | 360 | "Received %d bytes of audio data (total: %llu)\n", |
@@ -363,10 +363,10 @@ main (int argc, char *argv[]) | |||
363 | if (0 > ret) | 363 | if (0 > ret) |
364 | { | 364 | { |
365 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 365 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
366 | _("Read error from STDIN: %s\n"), | 366 | _("Read error from STDIN: %s\n"), |
367 | strerror (errno)); | 367 | strerror (errno)); |
368 | break; | 368 | break; |
369 | } | 369 | } |
370 | if (0 == ret) | 370 | if (0 == ret) |
371 | break; | 371 | break; |
372 | GNUNET_SERVER_mst_receive (stdin_mst, NULL, | 372 | GNUNET_SERVER_mst_receive (stdin_mst, NULL, |
diff --git a/src/conversation/gnunet-helper-audio-record.c b/src/conversation/gnunet-helper-audio-record.c index 54c9b7909..5e42de2b5 100644 --- a/src/conversation/gnunet-helper-audio-record.c +++ b/src/conversation/gnunet-helper-audio-record.c | |||
@@ -92,7 +92,7 @@ static unsigned char *opus_data; | |||
92 | static float *pcm_buffer; | 92 | static float *pcm_buffer; |
93 | 93 | ||
94 | /** | 94 | /** |
95 | * Length of the pcm data needed for one OPUS frame | 95 | * Length of the pcm data needed for one OPUS frame |
96 | */ | 96 | */ |
97 | static int pcm_length; | 97 | static int pcm_length; |
98 | 98 | ||
@@ -151,7 +151,7 @@ packetizer () | |||
151 | size_t off; | 151 | size_t off; |
152 | ssize_t ret; | 152 | ssize_t ret; |
153 | int len; // FIXME: int? | 153 | int len; // FIXME: int? |
154 | size_t msg_size; | 154 | size_t msg_size; |
155 | 155 | ||
156 | while (transmit_buffer_length >= transmit_buffer_index + pcm_length) | 156 | while (transmit_buffer_length >= transmit_buffer_index + pcm_length) |
157 | { | 157 | { |
@@ -195,9 +195,9 @@ packetizer () | |||
195 | if (0 != new_size) | 195 | if (0 != new_size) |
196 | { | 196 | { |
197 | nbuf = pa_xmalloc (new_size); | 197 | nbuf = pa_xmalloc (new_size); |
198 | memmove (nbuf, | 198 | memmove (nbuf, |
199 | &transmit_buffer[transmit_buffer_index], | 199 | &transmit_buffer[transmit_buffer_index], |
200 | new_size); | 200 | new_size); |
201 | pa_xfree (transmit_buffer); | 201 | pa_xfree (transmit_buffer); |
202 | transmit_buffer = nbuf; | 202 | transmit_buffer = nbuf; |
203 | } | 203 | } |
@@ -207,7 +207,7 @@ packetizer () | |||
207 | transmit_buffer = NULL; | 207 | transmit_buffer = NULL; |
208 | } | 208 | } |
209 | transmit_buffer_index = 0; | 209 | transmit_buffer_index = 0; |
210 | transmit_buffer_length = new_size; | 210 | transmit_buffer_length = new_size; |
211 | } | 211 | } |
212 | 212 | ||
213 | 213 | ||
@@ -216,7 +216,7 @@ packetizer () | |||
216 | */ | 216 | */ |
217 | static void | 217 | static void |
218 | stream_read_callback (pa_stream * s, | 218 | stream_read_callback (pa_stream * s, |
219 | size_t length, | 219 | size_t length, |
220 | void *userdata) | 220 | void *userdata) |
221 | { | 221 | { |
222 | const void *data; | 222 | const void *data; |
@@ -233,7 +233,7 @@ stream_read_callback (pa_stream * s, | |||
233 | 233 | ||
234 | if (pa_stream_peek (s, (const void **) &data, &length) < 0) | 234 | if (pa_stream_peek (s, (const void **) &data, &length) < 0) |
235 | { | 235 | { |
236 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 236 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
237 | _("pa_stream_peek() failed: %s\n"), | 237 | _("pa_stream_peek() failed: %s\n"), |
238 | pa_strerror (pa_context_errno (context))); | 238 | pa_strerror (pa_context_errno (context))); |
239 | quit (1); | 239 | quit (1); |
@@ -243,9 +243,9 @@ stream_read_callback (pa_stream * s, | |||
243 | GNUNET_assert (length > 0); | 243 | GNUNET_assert (length > 0); |
244 | if (NULL != transmit_buffer) | 244 | if (NULL != transmit_buffer) |
245 | { | 245 | { |
246 | transmit_buffer = pa_xrealloc (transmit_buffer, | 246 | transmit_buffer = pa_xrealloc (transmit_buffer, |
247 | transmit_buffer_length + length); | 247 | transmit_buffer_length + length); |
248 | memcpy (&transmit_buffer[transmit_buffer_length], | 248 | memcpy (&transmit_buffer[transmit_buffer_length], |
249 | data, | 249 | data, |
250 | length); | 250 | length); |
251 | transmit_buffer_length += length; | 251 | transmit_buffer_length += length; |
@@ -266,12 +266,12 @@ stream_read_callback (pa_stream * s, | |||
266 | * Exit callback for SIGTERM and SIGINT | 266 | * Exit callback for SIGTERM and SIGINT |
267 | */ | 267 | */ |
268 | static void | 268 | static void |
269 | exit_signal_callback (pa_mainloop_api * m, | 269 | exit_signal_callback (pa_mainloop_api * m, |
270 | pa_signal_event * e, | 270 | pa_signal_event * e, |
271 | int sig, | 271 | int sig, |
272 | void *userdata) | 272 | void *userdata) |
273 | { | 273 | { |
274 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 274 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
275 | _("Got signal, exiting.\n")); | 275 | _("Got signal, exiting.\n")); |
276 | quit (1); | 276 | quit (1); |
277 | } | 277 | } |
@@ -289,17 +289,17 @@ stream_state_callback (pa_stream * s, void *userdata) | |||
289 | { | 289 | { |
290 | case PA_STREAM_CREATING: | 290 | case PA_STREAM_CREATING: |
291 | case PA_STREAM_TERMINATED: | 291 | case PA_STREAM_TERMINATED: |
292 | break; | 292 | break; |
293 | case PA_STREAM_READY: | 293 | case PA_STREAM_READY: |
294 | { | 294 | { |
295 | const pa_buffer_attr *a; | 295 | const pa_buffer_attr *a; |
296 | 296 | ||
297 | char cmt[PA_CHANNEL_MAP_SNPRINT_MAX], | 297 | char cmt[PA_CHANNEL_MAP_SNPRINT_MAX], |
298 | sst[PA_SAMPLE_SPEC_SNPRINT_MAX]; | 298 | sst[PA_SAMPLE_SPEC_SNPRINT_MAX]; |
299 | 299 | ||
300 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 300 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
301 | _("Stream successfully created.\n")); | 301 | _("Stream successfully created.\n")); |
302 | 302 | ||
303 | if (!(a = pa_stream_get_buffer_attr (s))) | 303 | if (!(a = pa_stream_get_buffer_attr (s))) |
304 | { | 304 | { |
305 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 305 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -313,24 +313,24 @@ stream_state_callback (pa_stream * s, void *userdata) | |||
313 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 313 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
314 | _("Buffer metrics: maxlength=%u, fragsize=%u\n"), | 314 | _("Buffer metrics: maxlength=%u, fragsize=%u\n"), |
315 | a->maxlength, a->fragsize); | 315 | a->maxlength, a->fragsize); |
316 | } | 316 | } |
317 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 317 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
318 | _("Using sample spec '%s', channel map '%s'.\n"), | 318 | _("Using sample spec '%s', channel map '%s'.\n"), |
319 | pa_sample_spec_snprint (sst, sizeof (sst), | 319 | pa_sample_spec_snprint (sst, sizeof (sst), |
320 | pa_stream_get_sample_spec (s)), | 320 | pa_stream_get_sample_spec (s)), |
321 | pa_channel_map_snprint (cmt, sizeof (cmt), | 321 | pa_channel_map_snprint (cmt, sizeof (cmt), |
322 | pa_stream_get_channel_map (s))); | 322 | pa_stream_get_channel_map (s))); |
323 | 323 | ||
324 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 324 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
325 | _("Connected to device %s (%u, %ssuspended).\n"), | 325 | _("Connected to device %s (%u, %ssuspended).\n"), |
326 | pa_stream_get_device_name (s), | 326 | pa_stream_get_device_name (s), |
327 | pa_stream_get_device_index (s), | 327 | pa_stream_get_device_index (s), |
328 | pa_stream_is_suspended (s) ? "" : "not "); | 328 | pa_stream_is_suspended (s) ? "" : "not "); |
329 | } | 329 | } |
330 | break; | 330 | break; |
331 | case PA_STREAM_FAILED: | 331 | case PA_STREAM_FAILED: |
332 | default: | 332 | default: |
333 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 333 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
334 | _("Stream error: %s\n"), | 334 | _("Stream error: %s\n"), |
335 | pa_strerror (pa_context_errno (pa_stream_get_context (s)))); | 335 | pa_strerror (pa_context_errno (pa_stream_get_context (s)))); |
336 | quit (1); | 336 | quit (1); |
@@ -357,9 +357,9 @@ context_state_callback (pa_context * c, | |||
357 | { | 357 | { |
358 | int r; | 358 | int r; |
359 | pa_buffer_attr na; | 359 | pa_buffer_attr na; |
360 | 360 | ||
361 | GNUNET_assert (!stream_in); | 361 | GNUNET_assert (!stream_in); |
362 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 362 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
363 | _("Connection established.\n")); | 363 | _("Connection established.\n")); |
364 | if (! (stream_in = | 364 | if (! (stream_in = |
365 | pa_stream_new (c, "GNUNET_VoIP recorder", &sample_spec, NULL))) | 365 | pa_stream_new (c, "GNUNET_VoIP recorder", &sample_spec, NULL))) |
@@ -374,7 +374,7 @@ context_state_callback (pa_context * c, | |||
374 | memset (&na, 0, sizeof (na)); | 374 | memset (&na, 0, sizeof (na)); |
375 | na.maxlength = UINT32_MAX; | 375 | na.maxlength = UINT32_MAX; |
376 | na.fragsize = pcm_length; | 376 | na.fragsize = pcm_length; |
377 | if ((r = pa_stream_connect_record (stream_in, NULL, &na, | 377 | if ((r = pa_stream_connect_record (stream_in, NULL, &na, |
378 | PA_STREAM_ADJUST_LATENCY)) < 0) | 378 | PA_STREAM_ADJUST_LATENCY)) < 0) |
379 | { | 379 | { |
380 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 380 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -382,12 +382,12 @@ context_state_callback (pa_context * c, | |||
382 | pa_strerror (pa_context_errno (c))); | 382 | pa_strerror (pa_context_errno (c))); |
383 | goto fail; | 383 | goto fail; |
384 | } | 384 | } |
385 | 385 | ||
386 | break; | 386 | break; |
387 | } | 387 | } |
388 | case PA_CONTEXT_TERMINATED: | 388 | case PA_CONTEXT_TERMINATED: |
389 | quit (0); | 389 | quit (0); |
390 | break; | 390 | break; |
391 | case PA_CONTEXT_FAILED: | 391 | case PA_CONTEXT_FAILED: |
392 | default: | 392 | default: |
393 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 393 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
@@ -413,13 +413,13 @@ pa_init () | |||
413 | 413 | ||
414 | if (!pa_sample_spec_valid (&sample_spec)) | 414 | if (!pa_sample_spec_valid (&sample_spec)) |
415 | { | 415 | { |
416 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 416 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
417 | _("Wrong Spec\n")); | 417 | _("Wrong Spec\n")); |
418 | } | 418 | } |
419 | /* set up main record loop */ | 419 | /* set up main record loop */ |
420 | if (!(m = pa_mainloop_new ())) | 420 | if (!(m = pa_mainloop_new ())) |
421 | { | 421 | { |
422 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 422 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
423 | _("pa_mainloop_new() failed.\n")); | 423 | _("pa_mainloop_new() failed.\n")); |
424 | } | 424 | } |
425 | mainloop_api = pa_mainloop_get_api (m); | 425 | mainloop_api = pa_mainloop_get_api (m); |
@@ -434,9 +434,9 @@ pa_init () | |||
434 | 434 | ||
435 | if (!(context = pa_context_new (mainloop_api, "GNUNET VoIP"))) | 435 | if (!(context = pa_context_new (mainloop_api, "GNUNET VoIP"))) |
436 | { | 436 | { |
437 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 437 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
438 | _("pa_context_new() failed.\n")); | 438 | _("pa_context_new() failed.\n")); |
439 | } | 439 | } |
440 | pa_context_set_state_callback (context, &context_state_callback, NULL); | 440 | pa_context_set_state_callback (context, &context_state_callback, NULL); |
441 | if (pa_context_connect (context, NULL, 0, NULL) < 0) | 441 | if (pa_context_connect (context, NULL, 0, NULL) < 0) |
442 | { | 442 | { |
@@ -446,7 +446,7 @@ pa_init () | |||
446 | } | 446 | } |
447 | if (pa_mainloop_run (m, &i) < 0) | 447 | if (pa_mainloop_run (m, &i) < 0) |
448 | { | 448 | { |
449 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 449 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
450 | _("pa_mainloop_run() failed.\n")); | 450 | _("pa_mainloop_run() failed.\n")); |
451 | } | 451 | } |
452 | } | 452 | } |
@@ -466,7 +466,7 @@ opus_init () | |||
466 | pcm_buffer = pa_xmalloc (pcm_length); | 466 | pcm_buffer = pa_xmalloc (pcm_length); |
467 | opus_data = GNUNET_malloc (max_payload_bytes); | 467 | opus_data = GNUNET_malloc (max_payload_bytes); |
468 | enc = opus_encoder_create (SAMPLING_RATE, | 468 | enc = opus_encoder_create (SAMPLING_RATE, |
469 | channels, | 469 | channels, |
470 | OPUS_APPLICATION_VOIP, | 470 | OPUS_APPLICATION_VOIP, |
471 | &err); | 471 | &err); |
472 | opus_encoder_ctl (enc, | 472 | opus_encoder_ctl (enc, |
diff --git a/src/conversation/gnunet-service-conversation.c b/src/conversation/gnunet-service-conversation.c index 85bbc0481..d19be5318 100644 --- a/src/conversation/gnunet-service-conversation.c +++ b/src/conversation/gnunet-service-conversation.c | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2013 Christian Grothoff (and other contributing authors) | 3 | (C) 2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with GNUnet; see the file COPYING. If not, write to the |
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
@@ -105,7 +105,7 @@ struct Line | |||
105 | * Handle for the reliable tunnel (contol data) | 105 | * Handle for the reliable tunnel (contol data) |
106 | */ | 106 | */ |
107 | struct GNUNET_MESH_Tunnel *tunnel_reliable; | 107 | struct GNUNET_MESH_Tunnel *tunnel_reliable; |
108 | 108 | ||
109 | /** | 109 | /** |
110 | * Handle for unreliable tunnel (audio data) | 110 | * Handle for unreliable tunnel (audio data) |
111 | */ | 111 | */ |
@@ -153,7 +153,7 @@ struct Line | |||
153 | 153 | ||
154 | /** | 154 | /** |
155 | * Current status of this line. | 155 | * Current status of this line. |
156 | */ | 156 | */ |
157 | enum LineStatus status; | 157 | enum LineStatus status; |
158 | 158 | ||
159 | }; | 159 | }; |
@@ -374,7 +374,7 @@ mq_done_finish_caller_shutdown (void *cls) | |||
374 | case LS_CALLER_SHUTDOWN: | 374 | case LS_CALLER_SHUTDOWN: |
375 | destroy_line_mesh_tunnels (line); | 375 | destroy_line_mesh_tunnels (line); |
376 | break; | 376 | break; |
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
380 | 380 | ||
@@ -536,7 +536,7 @@ transmit_line_audio (void *cls, | |||
536 | { | 536 | { |
537 | struct Line *line = cls; | 537 | struct Line *line = cls; |
538 | struct MeshAudioMessage *mam = buf; | 538 | struct MeshAudioMessage *mam = buf; |
539 | 539 | ||
540 | line->unreliable_mth = NULL; | 540 | line->unreliable_mth = NULL; |
541 | if ( (NULL == buf) || | 541 | if ( (NULL == buf) || |
542 | (size < sizeof (struct MeshAudioMessage) + line->audio_size) ) | 542 | (size < sizeof (struct MeshAudioMessage) + line->audio_size) ) |
@@ -553,7 +553,7 @@ transmit_line_audio (void *cls, | |||
553 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 553 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
554 | "Sending %u bytes of audio data via mesh\n", | 554 | "Sending %u bytes of audio data via mesh\n", |
555 | line->audio_size); | 555 | line->audio_size); |
556 | return sizeof (struct MeshAudioMessage) + line->audio_size; | 556 | return sizeof (struct MeshAudioMessage) + line->audio_size; |
557 | } | 557 | } |
558 | 558 | ||
559 | 559 | ||
@@ -610,7 +610,7 @@ handle_client_audio_message (void *cls, | |||
610 | { | 610 | { |
611 | GNUNET_log (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK, | 611 | GNUNET_log (GNUNET_ERROR_TYPE_INFO | GNUNET_ERROR_TYPE_BULK, |
612 | _("Mesh audio channel not ready; audio data dropped\n")); | 612 | _("Mesh audio channel not ready; audio data dropped\n")); |
613 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 613 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
614 | return; | 614 | return; |
615 | } | 615 | } |
616 | if (NULL != line->unreliable_mth) | 616 | if (NULL != line->unreliable_mth) |
@@ -632,7 +632,7 @@ handle_client_audio_message (void *cls, | |||
632 | line->unreliable_mth = GNUNET_MESH_notify_transmit_ready (line->tunnel_unreliable, | 632 | line->unreliable_mth = GNUNET_MESH_notify_transmit_ready (line->tunnel_unreliable, |
633 | GNUNET_NO, | 633 | GNUNET_NO, |
634 | GNUNET_TIME_UNIT_FOREVER_REL, | 634 | GNUNET_TIME_UNIT_FOREVER_REL, |
635 | sizeof (struct MeshAudioMessage) | 635 | sizeof (struct MeshAudioMessage) |
636 | + line->audio_size, | 636 | + line->audio_size, |
637 | &transmit_line_audio, | 637 | &transmit_line_audio, |
638 | line); | 638 | line); |
@@ -641,7 +641,7 @@ handle_client_audio_message (void *cls, | |||
641 | 641 | ||
642 | 642 | ||
643 | /** | 643 | /** |
644 | * We are done signalling shutdown to the other peer. | 644 | * We are done signalling shutdown to the other peer. |
645 | * Destroy the tunnel. | 645 | * Destroy the tunnel. |
646 | * | 646 | * |
647 | * @param cls the `struct GNUNET_MESH_tunnel` to destroy | 647 | * @param cls the `struct GNUNET_MESH_tunnel` to destroy |
@@ -650,7 +650,7 @@ static void | |||
650 | mq_done_destroy_tunnel (void *cls) | 650 | mq_done_destroy_tunnel (void *cls) |
651 | { | 651 | { |
652 | struct GNUNET_MESH_Tunnel *tunnel = cls; | 652 | struct GNUNET_MESH_Tunnel *tunnel = cls; |
653 | 653 | ||
654 | GNUNET_MESH_tunnel_destroy (tunnel); | 654 | GNUNET_MESH_tunnel_destroy (tunnel); |
655 | } | 655 | } |
656 | 656 | ||
@@ -675,7 +675,7 @@ handle_mesh_ring_message (void *cls, | |||
675 | struct GNUNET_MQ_Envelope *e; | 675 | struct GNUNET_MQ_Envelope *e; |
676 | struct MeshPhoneBusyMessage *busy; | 676 | struct MeshPhoneBusyMessage *busy; |
677 | struct ClientPhoneRingMessage cring; | 677 | struct ClientPhoneRingMessage cring; |
678 | 678 | ||
679 | msg = (const struct MeshPhoneRingMessage *) message; | 679 | msg = (const struct MeshPhoneRingMessage *) message; |
680 | if ( (msg->purpose.size != htonl (sizeof (struct GNUNET_PeerIdentity) * 2 + | 680 | if ( (msg->purpose.size != htonl (sizeof (struct GNUNET_PeerIdentity) * 2 + |
681 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + | 681 | sizeof (struct GNUNET_TIME_AbsoluteNBO) + |
@@ -690,11 +690,11 @@ handle_mesh_ring_message (void *cls, | |||
690 | GNUNET_break_op (0); | 690 | GNUNET_break_op (0); |
691 | return GNUNET_SYSERR; | 691 | return GNUNET_SYSERR; |
692 | } | 692 | } |
693 | for (line = lines_head; NULL != line; line = line->next) | 693 | for (line = lines_head; NULL != line; line = line->next) |
694 | if ( (line->local_line == ntohl (msg->remote_line)) && | 694 | if ( (line->local_line == ntohl (msg->remote_line)) && |
695 | (LS_CALLEE_LISTEN == line->status) ) | 695 | (LS_CALLEE_LISTEN == line->status) ) |
696 | break; | 696 | break; |
697 | if (NULL == line) | 697 | if (NULL == line) |
698 | { | 698 | { |
699 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 699 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
700 | _("No available phone for incoming call on line %u, sending BUSY signal\n"), | 700 | _("No available phone for incoming call on line %u, sending BUSY signal\n"), |
@@ -748,7 +748,7 @@ handle_mesh_hangup_message (void *cls, | |||
748 | size_t len = ntohs (message->size) - sizeof (struct MeshPhoneHangupMessage); | 748 | size_t len = ntohs (message->size) - sizeof (struct MeshPhoneHangupMessage); |
749 | char buf[len + sizeof (struct ClientPhoneHangupMessage)]; | 749 | char buf[len + sizeof (struct ClientPhoneHangupMessage)]; |
750 | struct ClientPhoneHangupMessage *hup; | 750 | struct ClientPhoneHangupMessage *hup; |
751 | 751 | ||
752 | msg = (const struct MeshPhoneHangupMessage *) message; | 752 | msg = (const struct MeshPhoneHangupMessage *) message; |
753 | len = ntohs (msg->header.size) - sizeof (struct MeshPhoneHangupMessage); | 753 | len = ntohs (msg->header.size) - sizeof (struct MeshPhoneHangupMessage); |
754 | reason = (const char *) &msg[1]; | 754 | reason = (const char *) &msg[1]; |
@@ -831,7 +831,7 @@ handle_mesh_pickup_message (void *cls, | |||
831 | size_t len = ntohs (message->size) - sizeof (struct MeshPhonePickupMessage); | 831 | size_t len = ntohs (message->size) - sizeof (struct MeshPhonePickupMessage); |
832 | char buf[len + sizeof (struct ClientPhonePickupMessage)]; | 832 | char buf[len + sizeof (struct ClientPhonePickupMessage)]; |
833 | struct ClientPhonePickupMessage *pick; | 833 | struct ClientPhonePickupMessage *pick; |
834 | 834 | ||
835 | msg = (const struct MeshPhonePickupMessage *) message; | 835 | msg = (const struct MeshPhonePickupMessage *) message; |
836 | len = ntohs (msg->header.size) - sizeof (struct MeshPhonePickupMessage); | 836 | len = ntohs (msg->header.size) - sizeof (struct MeshPhonePickupMessage); |
837 | metadata = (const char *) &msg[1]; | 837 | metadata = (const char *) &msg[1]; |
@@ -895,7 +895,7 @@ handle_mesh_pickup_message (void *cls, | |||
895 | if (NULL == line->tunnel_unreliable) | 895 | if (NULL == line->tunnel_unreliable) |
896 | { | 896 | { |
897 | GNUNET_break (0); | 897 | GNUNET_break (0); |
898 | } | 898 | } |
899 | return GNUNET_OK; | 899 | return GNUNET_OK; |
900 | } | 900 | } |
901 | 901 | ||
@@ -988,7 +988,7 @@ handle_mesh_audio_message (void *cls, | |||
988 | char buf[msize + sizeof (struct ClientAudioMessage)]; | 988 | char buf[msize + sizeof (struct ClientAudioMessage)]; |
989 | struct ClientAudioMessage *cam; | 989 | struct ClientAudioMessage *cam; |
990 | const union GNUNET_MESH_TunnelInfo *info; | 990 | const union GNUNET_MESH_TunnelInfo *info; |
991 | 991 | ||
992 | msg = (const struct MeshAudioMessage *) message; | 992 | msg = (const struct MeshAudioMessage *) message; |
993 | if (NULL == line) | 993 | if (NULL == line) |
994 | { | 994 | { |
@@ -1014,7 +1014,7 @@ handle_mesh_audio_message (void *cls, | |||
1014 | "Received AUDIO data for non-existing line %u, dropping.\n", | 1014 | "Received AUDIO data for non-existing line %u, dropping.\n", |
1015 | ntohl (msg->remote_line)); | 1015 | ntohl (msg->remote_line)); |
1016 | return GNUNET_SYSERR; | 1016 | return GNUNET_SYSERR; |
1017 | } | 1017 | } |
1018 | line->tunnel_unreliable = tunnel; | 1018 | line->tunnel_unreliable = tunnel; |
1019 | *tunnel_ctx = line; | 1019 | *tunnel_ctx = line; |
1020 | } | 1020 | } |
@@ -1047,11 +1047,11 @@ handle_mesh_audio_message (void *cls, | |||
1047 | static void * | 1047 | static void * |
1048 | inbound_tunnel (void *cls, | 1048 | inbound_tunnel (void *cls, |
1049 | struct GNUNET_MESH_Tunnel *tunnel, | 1049 | struct GNUNET_MESH_Tunnel *tunnel, |
1050 | const struct GNUNET_PeerIdentity *initiator, | 1050 | const struct GNUNET_PeerIdentity *initiator, |
1051 | uint32_t port) | 1051 | uint32_t port) |
1052 | { | 1052 | { |
1053 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, | 1053 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
1054 | _("Received incoming tunnel on port %u\n"), | 1054 | _("Received incoming tunnel on port %u\n"), |
1055 | (unsigned int) port); | 1055 | (unsigned int) port); |
1056 | return NULL; | 1056 | return NULL; |
1057 | } | 1057 | } |
@@ -1131,7 +1131,7 @@ inbound_end (void *cls, | |||
1131 | * @param client identification of the client | 1131 | * @param client identification of the client |
1132 | */ | 1132 | */ |
1133 | static void | 1133 | static void |
1134 | handle_client_disconnect (void *cls, | 1134 | handle_client_disconnect (void *cls, |
1135 | struct GNUNET_SERVER_Client *client) | 1135 | struct GNUNET_SERVER_Client *client) |
1136 | { | 1136 | { |
1137 | struct Line *line; | 1137 | struct Line *line; |
@@ -1155,7 +1155,7 @@ handle_client_disconnect (void *cls, | |||
1155 | 1155 | ||
1156 | /** | 1156 | /** |
1157 | * Shutdown nicely | 1157 | * Shutdown nicely |
1158 | * | 1158 | * |
1159 | * @param cls closure, NULL | 1159 | * @param cls closure, NULL |
1160 | * @param tc the task context | 1160 | * @param tc the task context |
1161 | */ | 1161 | */ |
@@ -1184,7 +1184,7 @@ do_shutdown (void *cls, | |||
1184 | * @param c configuration | 1184 | * @param c configuration |
1185 | */ | 1185 | */ |
1186 | static void | 1186 | static void |
1187 | run (void *cls, | 1187 | run (void *cls, |
1188 | struct GNUNET_SERVER_Handle *server, | 1188 | struct GNUNET_SERVER_Handle *server, |
1189 | const struct GNUNET_CONFIGURATION_Handle *c) | 1189 | const struct GNUNET_CONFIGURATION_Handle *c) |
1190 | { | 1190 | { |
@@ -1210,23 +1210,23 @@ run (void *cls, | |||
1210 | {&handle_mesh_ring_message, | 1210 | {&handle_mesh_ring_message, |
1211 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING, | 1211 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_RING, |
1212 | sizeof (struct MeshPhoneRingMessage)}, | 1212 | sizeof (struct MeshPhoneRingMessage)}, |
1213 | {&handle_mesh_hangup_message, | 1213 | {&handle_mesh_hangup_message, |
1214 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP, | 1214 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_HANG_UP, |
1215 | 0}, | 1215 | 0}, |
1216 | {&handle_mesh_pickup_message, | 1216 | {&handle_mesh_pickup_message, |
1217 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP, | 1217 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_PICK_UP, |
1218 | 0}, | 1218 | 0}, |
1219 | {&handle_mesh_busy_message, | 1219 | {&handle_mesh_busy_message, |
1220 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_BUSY, | 1220 | GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_PHONE_BUSY, |
1221 | sizeof (struct MeshPhoneBusyMessage)}, | 1221 | sizeof (struct MeshPhoneBusyMessage)}, |
1222 | {&handle_mesh_audio_message, GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO, | 1222 | {&handle_mesh_audio_message, GNUNET_MESSAGE_TYPE_CONVERSATION_MESH_AUDIO, |
1223 | 0}, | 1223 | 0}, |
1224 | {NULL, 0, 0} | 1224 | {NULL, 0, 0} |
1225 | }; | 1225 | }; |
1226 | static uint32_t ports[] = { | 1226 | static uint32_t ports[] = { |
1227 | GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL, | 1227 | GNUNET_APPLICATION_TYPE_CONVERSATION_CONTROL, |
1228 | GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO, | 1228 | GNUNET_APPLICATION_TYPE_CONVERSATION_AUDIO, |
1229 | 0 | 1229 | 0 |
1230 | }; | 1230 | }; |
1231 | 1231 | ||
1232 | cfg = c; | 1232 | cfg = c; |
@@ -1236,8 +1236,8 @@ run (void *cls, | |||
1236 | mesh = GNUNET_MESH_connect (cfg, | 1236 | mesh = GNUNET_MESH_connect (cfg, |
1237 | NULL, | 1237 | NULL, |
1238 | &inbound_tunnel, | 1238 | &inbound_tunnel, |
1239 | &inbound_end, | 1239 | &inbound_end, |
1240 | mesh_handlers, | 1240 | mesh_handlers, |
1241 | ports); | 1241 | ports); |
1242 | 1242 | ||
1243 | if (NULL == mesh) | 1243 | if (NULL == mesh) |
@@ -1249,7 +1249,7 @@ run (void *cls, | |||
1249 | nc = GNUNET_SERVER_notification_context_create (server, 16); | 1249 | nc = GNUNET_SERVER_notification_context_create (server, 16); |
1250 | GNUNET_SERVER_add_handlers (server, server_handlers); | 1250 | GNUNET_SERVER_add_handlers (server, server_handlers); |
1251 | GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); | 1251 | GNUNET_SERVER_disconnect_notify (server, &handle_client_disconnect, NULL); |
1252 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 1252 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
1253 | &do_shutdown, | 1253 | &do_shutdown, |
1254 | NULL); | 1254 | NULL); |
1255 | } | 1255 | } |
@@ -1263,12 +1263,12 @@ run (void *cls, | |||
1263 | * @return 0 ok, 1 on error | 1263 | * @return 0 ok, 1 on error |
1264 | */ | 1264 | */ |
1265 | int | 1265 | int |
1266 | main (int argc, | 1266 | main (int argc, |
1267 | char *const *argv) | 1267 | char *const *argv) |
1268 | { | 1268 | { |
1269 | return (GNUNET_OK == | 1269 | return (GNUNET_OK == |
1270 | GNUNET_SERVICE_run (argc, argv, | 1270 | GNUNET_SERVICE_run (argc, argv, |
1271 | "conversation", | 1271 | "conversation", |
1272 | GNUNET_SERVICE_OPTION_NONE, | 1272 | GNUNET_SERVICE_OPTION_NONE, |
1273 | &run, NULL)) ? 0 : 1; | 1273 | &run, NULL)) ? 0 : 1; |
1274 | } | 1274 | } |
diff --git a/src/conversation/microphone.c b/src/conversation/microphone.c index 2c399c74d..bc6044120 100644 --- a/src/conversation/microphone.c +++ b/src/conversation/microphone.c | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2013 Christian Grothoff (and other contributing authors) | 3 | (C) 2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with GNUnet; see the file COPYING. If not, write to the |
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
@@ -101,8 +101,8 @@ enable (void *cls, | |||
101 | GNUNET_MICROPHONE_RecordedDataCallback rdc, | 101 | GNUNET_MICROPHONE_RecordedDataCallback rdc, |
102 | void *rdc_cls) | 102 | void *rdc_cls) |
103 | { | 103 | { |
104 | struct Microphone *mic = cls; | 104 | struct Microphone *mic = cls; |
105 | static char * const record_helper_argv[] = | 105 | static char * const record_helper_argv[] = |
106 | { | 106 | { |
107 | "gnunet-helper-audio-record", | 107 | "gnunet-helper-audio-record", |
108 | NULL | 108 | NULL |
@@ -113,14 +113,14 @@ enable (void *cls, | |||
113 | mic->record_helper = GNUNET_HELPER_start (GNUNET_NO, | 113 | mic->record_helper = GNUNET_HELPER_start (GNUNET_NO, |
114 | "gnunet-helper-audio-record", | 114 | "gnunet-helper-audio-record", |
115 | record_helper_argv, | 115 | record_helper_argv, |
116 | &process_record_messages, | 116 | &process_record_messages, |
117 | NULL, mic); | 117 | NULL, mic); |
118 | if (NULL == mic->record_helper) | 118 | if (NULL == mic->record_helper) |
119 | { | 119 | { |
120 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 120 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
121 | _("Could not start record audio helper\n")); | 121 | _("Could not start record audio helper\n")); |
122 | return GNUNET_SYSERR; | 122 | return GNUNET_SYSERR; |
123 | } | 123 | } |
124 | return GNUNET_OK; | 124 | return GNUNET_OK; |
125 | } | 125 | } |
126 | 126 | ||
diff --git a/src/conversation/speaker.c b/src/conversation/speaker.c index d67346f1f..0f8661834 100644 --- a/src/conversation/speaker.c +++ b/src/conversation/speaker.c | |||
@@ -1,17 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet | 2 | This file is part of GNUnet |
3 | (C) 2013 Christian Grothoff (and other contributing authors) | 3 | (C) 2013 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; either version 3, or (at your | 7 | by the Free Software Foundation; either version 3, or (at your |
8 | option) any later version. | 8 | option) any later version. |
9 | 9 | ||
10 | GNUnet is distributed in the hope that it will be useful, but | 10 | GNUnet is distributed in the hope that it will be useful, but |
11 | WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | General Public License for more details. | 13 | General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNUnet; see the file COPYING. If not, write to the | 16 | along with GNUnet; see the file COPYING. If not, write to the |
17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
@@ -57,17 +57,17 @@ struct Speaker | |||
57 | static int | 57 | static int |
58 | enable (void *cls) | 58 | enable (void *cls) |
59 | { | 59 | { |
60 | struct Speaker *spe = cls; | 60 | struct Speaker *spe = cls; |
61 | static char *playback_helper_argv[] = | 61 | static char *playback_helper_argv[] = |
62 | { | 62 | { |
63 | "gnunet-helper-audio-playback", | 63 | "gnunet-helper-audio-playback", |
64 | NULL | 64 | NULL |
65 | }; | 65 | }; |
66 | 66 | ||
67 | spe->playback_helper = GNUNET_HELPER_start (GNUNET_NO, | 67 | spe->playback_helper = GNUNET_HELPER_start (GNUNET_NO, |
68 | "gnunet-helper-audio-playback", | 68 | "gnunet-helper-audio-playback", |
69 | playback_helper_argv, | 69 | playback_helper_argv, |
70 | NULL, | 70 | NULL, |
71 | NULL, spe); | 71 | NULL, spe); |
72 | if (NULL == spe->playback_helper) | 72 | if (NULL == spe->playback_helper) |
73 | { | 73 | { |
@@ -143,8 +143,8 @@ play (void *cls, | |||
143 | am->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO); | 143 | am->header.type = htons (GNUNET_MESSAGE_TYPE_CONVERSATION_AUDIO); |
144 | memcpy (&am[1], data, data_size); | 144 | memcpy (&am[1], data, data_size); |
145 | (void) GNUNET_HELPER_send (spe->playback_helper, | 145 | (void) GNUNET_HELPER_send (spe->playback_helper, |
146 | &am->header, | 146 | &am->header, |
147 | GNUNET_NO, | 147 | GNUNET_NO, |
148 | NULL, NULL); | 148 | NULL, NULL); |
149 | } | 149 | } |
150 | 150 | ||
diff --git a/src/conversation/test_conversation_api.c b/src/conversation/test_conversation_api.c index af2ff75e4..d18616721 100644 --- a/src/conversation/test_conversation_api.c +++ b/src/conversation/test_conversation_api.c | |||
@@ -76,7 +76,7 @@ check () | |||
76 | int | 76 | int |
77 | main (int argc, char *argv[]) | 77 | main (int argc, char *argv[]) |
78 | { | 78 | { |
79 | GNUNET_log_setup ("test_conversation_api", | 79 | GNUNET_log_setup ("test_conversation_api", |
80 | "WARNING", | 80 | "WARNING", |
81 | NULL); | 81 | NULL); |
82 | return check (); | 82 | return check (); |