mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Removed deprecated function from public api.
Added upper length check to friendreq_handlepacket().
This commit is contained in:
parent
8815956f0a
commit
09d9d34a93
|
@ -137,7 +137,7 @@ static int friendreq_handlepacket(void *object, uint8_t *source_pubkey, uint8_t
|
||||||
{
|
{
|
||||||
Friend_Requests *fr = object;
|
Friend_Requests *fr = object;
|
||||||
|
|
||||||
if (length <= 1 + sizeof(fr->nospam))
|
if (length <= 1 + sizeof(fr->nospam) || length > MAX_DATA_SIZE)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
++packet;
|
++packet;
|
||||||
|
|
|
@ -739,17 +739,6 @@ uint64_t tox_file_data_remaining(Tox *tox, int32_t friendnumber, uint8_t filenum
|
||||||
|
|
||||||
/***************END OF FILE SENDING FUNCTIONS******************/
|
/***************END OF FILE SENDING FUNCTIONS******************/
|
||||||
|
|
||||||
/* Use these functions to bootstrap the client.
|
|
||||||
* Sends a get nodes request to the given node with ip port and public_key.
|
|
||||||
*/
|
|
||||||
void tox_bootstrap_from_ip(Tox *tox, tox_IP_Port _ip_port, uint8_t *public_key)
|
|
||||||
{
|
|
||||||
Messenger *m = tox;
|
|
||||||
IP_Port ip_port;
|
|
||||||
memcpy(&ip_port, &_ip_port, sizeof(IP_Port));
|
|
||||||
DHT_bootstrap(m->dht, ip_port, public_key);
|
|
||||||
}
|
|
||||||
|
|
||||||
int tox_bootstrap_from_address(Tox *tox, const char *address,
|
int tox_bootstrap_from_address(Tox *tox, const char *address,
|
||||||
uint8_t ipv6enabled, uint16_t port, uint8_t *public_key)
|
uint8_t ipv6enabled, uint16_t port, uint8_t *public_key)
|
||||||
{
|
{
|
||||||
|
|
|
@ -601,43 +601,6 @@ uint64_t tox_file_data_remaining(Tox *tox, int32_t friendnumber, uint8_t filenum
|
||||||
|
|
||||||
/***************END OF FILE SENDING FUNCTIONS******************/
|
/***************END OF FILE SENDING FUNCTIONS******************/
|
||||||
|
|
||||||
/* WARNING: DEPRECATED, DO NOT USE. */
|
|
||||||
typedef union {
|
|
||||||
uint8_t c[4];
|
|
||||||
uint16_t s[2];
|
|
||||||
uint32_t i;
|
|
||||||
} tox_IP4;
|
|
||||||
|
|
||||||
typedef union {
|
|
||||||
uint8_t uint8[16];
|
|
||||||
uint16_t uint16[8];
|
|
||||||
uint32_t uint32[4];
|
|
||||||
struct in6_addr in6_addr;
|
|
||||||
} tox_IP6;
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
uint8_t family;
|
|
||||||
/* Not used for anything right now. */
|
|
||||||
uint8_t padding[3];
|
|
||||||
union {
|
|
||||||
tox_IP4 ip4;
|
|
||||||
tox_IP6 ip6;
|
|
||||||
};
|
|
||||||
} tox_IP;
|
|
||||||
|
|
||||||
/* will replace IP_Port as soon as the complete infrastructure is in place
|
|
||||||
* removed the unused union and padding also */
|
|
||||||
typedef struct {
|
|
||||||
tox_IP ip;
|
|
||||||
uint16_t port;
|
|
||||||
} tox_IP_Port;
|
|
||||||
/* WARNING: DEPRECATED, DO NOT USE. */
|
|
||||||
/* Sends a "get nodes" request to the given node with ip, port and public_key
|
|
||||||
* to setup connections
|
|
||||||
*/
|
|
||||||
void tox_bootstrap_from_ip(Tox *tox, tox_IP_Port ip_port, uint8_t *public_key);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Use this function to bootstrap the client.
|
* Use this function to bootstrap the client.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user