hs init recv logic, + fs send init ack (not tracking it yet)
This commit is contained in:
12
ngc_ft1.cpp
12
ngc_ft1.cpp
@@ -300,6 +300,7 @@ static void _handle_FT1_INIT(
|
||||
fprintf(stderr, "]\n");
|
||||
|
||||
// check if slot free ?
|
||||
// did we allready ack this and the other side just did not see the ack?
|
||||
|
||||
NGC_FT1_recv_init_cb* fn_ptr = nullptr;
|
||||
if (ngc_ext_ctx->ngc_ft1_ctx->cb_init.count(file_kind)) {
|
||||
@@ -316,8 +317,19 @@ static void _handle_FT1_INIT(
|
||||
|
||||
if (accept_ft) {
|
||||
// send ack
|
||||
// - 1 byte packet id
|
||||
// - 1 byte transfer_id
|
||||
std::vector<uint8_t> pkg;
|
||||
pkg.push_back(FT1_INIT_ACK);
|
||||
pkg.push_back(transfer_id);
|
||||
|
||||
// lossless
|
||||
tox_group_send_custom_private_packet(tox, group_number, peer_number, true, pkg.data(), pkg.size(), nullptr);
|
||||
|
||||
fprintf(stderr, "accepted init\n");
|
||||
} else {
|
||||
// TODO deny?
|
||||
fprintf(stderr, "rejected init\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user