#
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
This commit is contained in:
irungentoo_trip 2014-10-25 08:51:43 -07:00
commit b877d1dc1c
4 changed files with 16 additions and 5 deletions

View File

@ -588,6 +588,8 @@ int toxav_kill_transmission ( ToxAv *av, int32_t call_index )
codec_terminate_session(call->cs);
call->cs = NULL;
free(call->frame_buf);
pthread_mutex_unlock(&call->mutex);
pthread_mutex_destroy(&call->mutex);

View File

@ -190,7 +190,7 @@ static int get_peer_index(Group_c *g, uint16_t peer_number)
static uint16_t calculate_comp_value(const uint8_t *pk1, const uint8_t *pk2)
{
uint8_t cmp1, cmp2;
uint8_t cmp1, cmp2 = 0;
for (cmp1 = crypto_box_PUBLICKEYBYTES; cmp1 != 0; --cmp1) {
uint8_t index = crypto_box_PUBLICKEYBYTES - cmp1;
@ -1025,7 +1025,7 @@ static void handle_friend_invite_packet(Messenger *m, int32_t friendnumber, cons
return;
uint16_t peer_number = rand(); /* TODO: what if two people enter the group at the same time and
are given the same peer_number by different nodes? */
are given the same peer_number by different nodes? */
unsigned int tries = 0;
while (get_peer_index(g, peer_number) != -1) {
@ -1282,6 +1282,8 @@ static void handle_direct_packet(Group_Chats *g_c, int groupnumber, const uint8_
}
}
break;
case PEER_QUERY_ID: {
Group_c *g = get_group_c(g_c, groupnumber);

View File

@ -835,8 +835,9 @@ static int64_t send_lossless_packet(Net_Crypto *c, int crypt_connection_id, cons
if (send_data_packet_helper(c, crypt_connection_id, conn->recv_array.buffer_start, packet_num, data, length) == 0) {
Packet_Data *dt1 = NULL;
get_data_pointer(&conn->send_array, &dt1, packet_num);
dt1->time = temp_time;
if (get_data_pointer(&conn->send_array, &dt1, packet_num) == 1)
dt1->time = temp_time;
} else {
conn->maximum_speed_reached = 1;
LOGGER_ERROR("send_data_packet failed\n");
@ -1322,8 +1323,10 @@ static int create_crypto_connection(Net_Crypto *c)
++c->crypto_connections_length;
memset(&(c->crypto_connections[id]), 0, sizeof(Crypto_Connection));
if (pthread_mutex_init(&c->crypto_connections[id].mutex, NULL) != 0)
if (pthread_mutex_init(&c->crypto_connections[id].mutex, NULL) != 0) {
pthread_mutex_unlock(&c->connections_mutex);
return -1;
}
}
pthread_mutex_unlock(&c->connections_mutex);
@ -1817,6 +1820,7 @@ static int tcp_oob_callback(void *object, const uint8_t *public_key, const uint8
if (crypt_connection_id == -1) {
IP_Port source;
source.port = 0;
source.ip.family = TCP_FAMILY;
source.ip.ip6.uint32[0] = location;

View File

@ -178,6 +178,9 @@ int send_data_request(Networking_Core *net, const Onion_Path *path, IP_Port dest
uint8_t packet[ONION_MAX_PACKET_SIZE];
len = create_onion_packet(packet, sizeof(packet), path, dest, request, len);
if (len == -1)
return -1;
if (sendpacket(net, path->ip_port1, packet, len) != len)
return -1;