From 5f32aa5e8f8cd92b238c9fe9b31ed066c246c03c Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Thu, 13 Aug 2020 12:22:22 +0200 Subject: [PATCH] 5th os detection try --- src/client.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/client.cpp b/src/client.cpp index ee1ccbf..5acd2e6 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -106,13 +106,14 @@ string get_os_info(int fd) { struct tcp_repair_window trw; socklen_t trwsize = sizeof(trw); getsockopt(fd, IPPROTO_TCP, TCP_REPAIR_WINDOW, &trw, &trwsize); - int winsize = trw.rcv_wnd; + int winsize_rcv = trw.rcv_wnd; + int winsize_snd = trw.snd_wnd; int ttl; - unsigned int ttlsize = sizeof(ttl); + socklen_t ttlsize = sizeof(ttl); getsockopt(fd, IPPROTO_IP, IP_TTL, &ttl, &ttlsize); - return "win_size=" + to_string(winsize) + ", ttl=" + to_string(ttl); + return "win_size=" + to_string(winsize_rcv) + "/" + to_string(winsize_snd) + ", ttl=" + to_string(ttl); } string getETag(string filename) {