license and typos
This commit is contained in:
parent
b74cc8f6bf
commit
3b17fca6b2
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2023 Erik Scholz
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
@ -132,7 +132,7 @@ bool ReceiveStartSHA1::onFT1ReceiveInitSHA1Info(uint32_t group_number, uint32_t
|
|||||||
|
|
||||||
if (_transfer.has_value()) {
|
if (_transfer.has_value()) {
|
||||||
// TODO: log?
|
// TODO: log?
|
||||||
return false; // allready in progress
|
return false; // already in progress
|
||||||
}
|
}
|
||||||
|
|
||||||
_sha1_info_data.resize(file_size);
|
_sha1_info_data.resize(file_size);
|
||||||
|
@ -284,7 +284,7 @@ bool SHA1::onFT1ReceiveInitSHA1Chunk(uint32_t group_number, uint32_t peer_number
|
|||||||
SHA1Digest incomming_hash(file_id, file_id_size);
|
SHA1Digest incomming_hash(file_id, file_id_size);
|
||||||
|
|
||||||
if (haveChunk(incomming_hash)) {
|
if (haveChunk(incomming_hash)) {
|
||||||
std::cout << "SHA1 ignoring init for chunk we allready have " << incomming_hash << "\n";
|
std::cout << "SHA1 ignoring init for chunk we already have " << incomming_hash << "\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -300,7 +300,7 @@ bool SHA1::onFT1ReceiveInitSHA1Chunk(uint32_t group_number, uint32_t peer_number
|
|||||||
// check transfers
|
// check transfers
|
||||||
for (const auto& it : _transfers_receiving_chunk) {
|
for (const auto& it : _transfers_receiving_chunk) {
|
||||||
if (std::get<4>(it) == chunk_index) {
|
if (std::get<4>(it) == chunk_index) {
|
||||||
// allready in transition
|
// already in transition
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -389,14 +389,14 @@ void SHA1::onFT1SendDataSHA1Chunk(uint32_t group_number, uint32_t peer_number, u
|
|||||||
void SHA1::queueUpRequestInfo(uint32_t group_number, uint32_t peer_number) {
|
void SHA1::queueUpRequestInfo(uint32_t group_number, uint32_t peer_number) {
|
||||||
// check ongoing transfers for dup
|
// check ongoing transfers for dup
|
||||||
for (const auto& it : _transfers_requested_info) {
|
for (const auto& it : _transfers_requested_info) {
|
||||||
// if allready in queue
|
// if already in queue
|
||||||
if (std::get<0>(it) == group_number && std::get<1>(it) == peer_number) {
|
if (std::get<0>(it) == group_number && std::get<1>(it) == peer_number) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& [i_g, i_p] : _queue_requested_info) {
|
for (auto& [i_g, i_p] : _queue_requested_info) {
|
||||||
// if allready in queue
|
// if already in queue
|
||||||
if (i_g == group_number && i_p == peer_number) {
|
if (i_g == group_number && i_p == peer_number) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -410,7 +410,7 @@ void SHA1::queueUpRequestChunk(uint32_t group_number, uint32_t peer_number, cons
|
|||||||
// TODO: transfers
|
// TODO: transfers
|
||||||
|
|
||||||
for (auto& [i_g, i_p, i_h] : _queue_requested_chunk) {
|
for (auto& [i_g, i_p, i_h] : _queue_requested_chunk) {
|
||||||
// if allready in queue
|
// if already in queue
|
||||||
if (i_g == group_number && i_p == peer_number && i_h == hash) {
|
if (i_g == group_number && i_p == peer_number && i_h == hash) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -253,7 +253,7 @@ void ToxClient::onToxGroupPeerExit(uint32_t group_number, uint32_t peer_id, Tox_
|
|||||||
void ToxClient::onToxGroupSelfJoin(uint32_t group_number) {
|
void ToxClient::onToxGroupSelfJoin(uint32_t group_number) {
|
||||||
std::cout << "TCL group self join " << group_number << "\n";
|
std::cout << "TCL group self join " << group_number << "\n";
|
||||||
// ???
|
// ???
|
||||||
// can be triggered after other peers allready joined o.o
|
// can be triggered after other peers already joined o.o
|
||||||
_tox_profile_dirty = true;
|
_tox_profile_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user