Fix a few Bugs

This commit is contained in:
Florian Märkl 2019-06-28 16:30:17 +02:00
commit a45ea63598
No known key found for this signature in database
GPG key ID: 125BC8A5A6A1E857
3 changed files with 9 additions and 1 deletions

View file

@ -74,6 +74,8 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_senkusha_run(ChiakiSession *session)
err = set_port(takion_info.sa, htons(SENKUSHA_PORT)); err = set_port(takion_info.sa, htons(SENKUSHA_PORT));
assert(err == CHIAKI_ERR_SUCCESS); assert(err == CHIAKI_ERR_SUCCESS);
takion_info.enable_crypt = false;
takion_info.cb = senkusha_takion_cb; takion_info.cb = senkusha_takion_cb;
takion_info.cb_user = &senkusha; takion_info.cb_user = &senkusha;

View file

@ -126,6 +126,8 @@ CHIAKI_EXPORT ChiakiErrorCode chiaki_stream_connection_run(ChiakiStreamConnectio
err = set_port(takion_info.sa, htons(STREAM_CONNECTION_PORT)); err = set_port(takion_info.sa, htons(STREAM_CONNECTION_PORT));
assert(err == CHIAKI_ERR_SUCCESS); assert(err == CHIAKI_ERR_SUCCESS);
takion_info.enable_crypt = true;
takion_info.cb = stream_connection_takion_cb; takion_info.cb = stream_connection_takion_cb;
takion_info.cb_user = stream_connection; takion_info.cb_user = stream_connection;

View file

@ -501,6 +501,8 @@ static ChiakiErrorCode takion_handshake(ChiakiTakion *takion)
static void takion_data_drop(uint64_t seq_num, void *elem_user, void *cb_user) static void takion_data_drop(uint64_t seq_num, void *elem_user, void *cb_user)
{ {
ChiakiTakion *takion = cb_user;
CHIAKI_LOGE(takion->log, "Takion dropping data with seq num %llx\n", (unsigned long long)seq_num);
TakionDataPacketEntry *entry = elem_user; TakionDataPacketEntry *entry = elem_user;
free(entry->packet_buf); free(entry->packet_buf);
free(entry); free(entry);
@ -516,7 +518,7 @@ static void *takion_thread_func(void *user)
if(chiaki_reorder_queue_init_32(&takion->data_queue, TAKION_REORDER_QUEUE_SIZE_EXP, takion->tag_remote) != CHIAKI_ERR_SUCCESS) if(chiaki_reorder_queue_init_32(&takion->data_queue, TAKION_REORDER_QUEUE_SIZE_EXP, takion->tag_remote) != CHIAKI_ERR_SUCCESS)
goto beach; goto beach;
chiaki_reorder_queue_set_drop_cb(&takion->data_queue, takion_data_drop, NULL); chiaki_reorder_queue_set_drop_cb(&takion->data_queue, takion_data_drop, takion);
// TODO ChiakiCongestionControl congestion_control; // TODO ChiakiCongestionControl congestion_control;
// if(chiaki_congestion_control_start(&congestion_control, takion) != CHIAKI_ERR_SUCCESS) // if(chiaki_congestion_control_start(&congestion_control, takion) != CHIAKI_ERR_SUCCESS)
@ -794,6 +796,8 @@ static void takion_handle_packet_message_data(ChiakiTakion *takion, uint8_t *pac
return; return;
entry->type_b = type_b; entry->type_b = type_b;
entry->packet_buf = packet_buf;
entry->packet_size = packet_buf_size;
entry->payload = payload; entry->payload = payload;
entry->payload_size = payload_size; entry->payload_size = payload_size;
entry->channel = ntohs(*((uint16_t *)(payload + 4))); entry->channel = ntohs(*((uint16_t *)(payload + 4)));