Compare commits
No commits in common. "e065c4f8ef82982e3d94e62bece0e871a52ff839" and "19ae6e9dcb3a166e88c6e9951807ae1f60541eb0" have entirely different histories.
e065c4f8ef
...
19ae6e9dcb
2 changed files with 1 additions and 8 deletions
4
libtel.c
4
libtel.c
|
@ -1,5 +1,4 @@
|
|||
#include <arpa/inet.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
@ -55,9 +54,8 @@ int tel_get_addr(char *ip, char *port, struct sockaddr **addr, socklen_t *addr_l
|
|||
int res = getaddrinfo(ip, port, &hints, &info);
|
||||
if(res != 0) return res;
|
||||
|
||||
*addr = malloc(info->ai_addrlen);
|
||||
*addr = info->ai_addr;
|
||||
*addr_len = info->ai_addrlen;
|
||||
memcpy(*addr, info->ai_addr, info->ai_addrlen);
|
||||
|
||||
freeaddrinfo(info);
|
||||
return 0;
|
||||
|
|
5
teld.c
5
teld.c
|
@ -157,7 +157,6 @@ void client_pickup(struct call_buf *call_buf, int stream) {
|
|||
union tel_sa_any remote_addr;
|
||||
socklen_t remote_addr_len = sizeof(union tel_sa_any);
|
||||
res = tel_read_sockaddr(stream, &remote_addr, &remote_addr_len);
|
||||
if(res < 0) goto err;
|
||||
|
||||
int idx = call_buf_search(call_buf, &remote_addr);
|
||||
if(idx < 0) {
|
||||
|
@ -176,10 +175,6 @@ void client_pickup(struct call_buf *call_buf, int stream) {
|
|||
};
|
||||
close(fd);
|
||||
return;
|
||||
|
||||
err:
|
||||
printf("error picking up call: %s\n", strerror(errno));
|
||||
tel_write_err(stream, strerror(errno));
|
||||
}
|
||||
|
||||
void client_call(int stream, struct config cfg) {
|
||||
|
|
Loading…
Reference in a new issue