X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=client.cpp;h=bb2d26cdcd4abec4516d23ae92142636a33ac341;hb=4856c49f1b63753ce86ad759ee649a1117628a8e;hp=3a2552172d6a924ad41d68db874edbf4f1db17b7;hpb=95ffb595e77280a7ce9e2412ce746565fb760020;p=cubemap diff --git a/client.cpp b/client.cpp index 3a25521..bb2d26c 100644 --- a/client.cpp +++ b/client.cpp @@ -4,6 +4,7 @@ #include #include "client.h" +#include "log.h" #include "markpool.h" #include "state.pb.h" #include "stream.h" @@ -29,12 +30,12 @@ Client::Client(int sock) socklen_t addr_len = sizeof(addr); if (getpeername(sock, reinterpret_cast(&addr), &addr_len) == -1) { - perror("getpeername"); + log_perror("getpeername"); remote_addr = ""; } else { char buf[INET6_ADDRSTRLEN]; if (inet_ntop(addr.sin6_family, &addr.sin6_addr, buf, sizeof(buf)) == NULL) { - perror("inet_ntop"); + log_perror("inet_ntop"); remote_addr = ""; } else { remote_addr = buf; @@ -64,7 +65,7 @@ Client::Client(const ClientProto &serialized, Stream *stream) } if (setsockopt(sock, SOL_SOCKET, SO_MARK, &fwmark, sizeof(fwmark)) == -1) { if (fwmark != 0) { - perror("setsockopt(SO_MARK)"); + log_perror("setsockopt(SO_MARK)"); } } }