mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Fixed an issue in list.
Cleaned up TCP server a bit.
This commit is contained in:
parent
b6cbdefb55
commit
ad28acd18e
|
@ -990,7 +990,7 @@ static int do_unconfirmed(TCP_Server *TCP_server, uint32_t i)
|
|||
}
|
||||
}
|
||||
|
||||
static int do_confirmed_recv(TCP_Server *TCP_server, uint32_t i)
|
||||
static void do_confirmed_recv(TCP_Server *TCP_server, uint32_t i)
|
||||
{
|
||||
TCP_Secure_Connection *conn = &TCP_server->accepted_connection_array[i];
|
||||
|
||||
|
@ -1130,8 +1130,6 @@ static void do_TCP_epoll(TCP_Server *TCP_server)
|
|||
|
||||
sock_new = accept(sock, (struct sockaddr *)&addr, &addrlen);
|
||||
|
||||
struct sockaddr a = *(struct sockaddr *)&addr;
|
||||
|
||||
int index_new = TCP_server->incomming_connection_queue_index % MAX_INCOMMING_CONNECTIONS;
|
||||
|
||||
if (!accept_connection(TCP_server, sock_new)) {
|
||||
|
|
|
@ -108,9 +108,9 @@ typedef struct TCP_Secure_Connection {
|
|||
typedef struct {
|
||||
Onion *onion;
|
||||
|
||||
#ifdef TCP_SERVER_USE_EPOLL
|
||||
#ifdef TCP_SERVER_USE_EPOLL
|
||||
int efd;
|
||||
#endif
|
||||
#endif
|
||||
sock_t *socks_listening;
|
||||
unsigned int num_listening_socks;
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ int list_find(LIST *list, void *data)
|
|||
|
||||
//return only -1 and positive values
|
||||
if (r < 0) {
|
||||
r = -1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
return list->ids[r];
|
||||
|
|
Loading…
Reference in New Issue
Block a user