aboutsummaryrefslogtreecommitdiff
path: root/src/conversation
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2014-01-13 21:10:15 +0000
committerLRN <lrn1986@gmail.com>2014-01-13 21:10:15 +0000
commit13c1d3cddb12daf5667a673b2d169087952c8616 (patch)
treed507264e252bcbc7091bba25389ab85707a822fd /src/conversation
parent99f57129eb1e3654d3f5e3f9a5491a2eb1276686 (diff)
downloadgnunet-13c1d3cddb12daf5667a673b2d169087952c8616.tar.gz
gnunet-13c1d3cddb12daf5667a673b2d169087952c8616.zip
Don't transmit partial packets
Diffstat (limited to 'src/conversation')
-rw-r--r--src/conversation/gnunet-helper-audio-record.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/conversation/gnunet-helper-audio-record.c b/src/conversation/gnunet-helper-audio-record.c
index 890312213..20812599f 100644
--- a/src/conversation/gnunet-helper-audio-record.c
+++ b/src/conversation/gnunet-helper-audio-record.c
@@ -162,11 +162,14 @@ packetizer ()
162 len = 162 len =
163 opus_encode_float (enc, pcm_buffer, frame_size, opus_data, 163 opus_encode_float (enc, pcm_buffer, frame_size, opus_data,
164 max_payload_bytes); 164 max_payload_bytes);
165
165 if (len > UINT16_MAX - sizeof (struct AudioMessage)) 166 if (len > UINT16_MAX - sizeof (struct AudioMessage))
166 { 167 {
167 GNUNET_break (0); 168 GNUNET_break (0);
168 len = UINT16_MAX - sizeof (struct AudioMessage); 169 continue;
169 } 170 }
171
172
170 msg_size = sizeof (struct AudioMessage) + len; 173 msg_size = sizeof (struct AudioMessage) + len;
171 audio_message->header.size = htons ((uint16_t) msg_size); 174 audio_message->header.size = htons ((uint16_t) msg_size);
172 memcpy (&audio_message[1], opus_data, len); 175 memcpy (&audio_message[1], opus_data, len);