diff options
| author | Nakidai <nakidai@disroot.org> | 2024-09-26 00:14:12 +0300 |
|---|---|---|
| committer | Nakidai <nakidai@disroot.org> | 2024-09-26 00:14:59 +0300 |
| commit | b50e57cc138fd19ed19da665daba54890995dca3 (patch) | |
| tree | 2c9d65b823fd1133aef19879eba7dcfce8b75e31 /cptc.c | |
| parent | 0caf047c3c1ecf34a47061951e838d05574dbd6c (diff) | |
| download | cptc-b50e57cc138fd19ed19da665daba54890995dca3.tar.gz cptc-b50e57cc138fd19ed19da665daba54890995dca3.zip | |
Now it will work
Diffstat (limited to 'cptc.c')
| -rw-r--r-- | cptc.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cptc.c b/cptc.c index 60c1954..485c39f 100644 --- a/cptc.c +++ b/cptc.c @@ -1,11 +1,15 @@ +#include "cptc.h" + #include <stdio.h> #include <stdlib.h> + #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> -#include "cptc.h" +#include <curl/curl.h> +#include <curl/easy.h> #define error(text, status) \ @@ -22,8 +26,12 @@ void CPTC(const char *ip, in_port_t port) socklen_t peer_size; int fd, peerfd; + curl_easy_init(); + if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) error("socket()", 1); + if ((setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &(int){1}, sizeof(int))) < 0) + error("setsockopt()", 1); addr = (struct sockaddr_in) { |