From 7c8ac749f7ff06ae0ccd11facf6b7ca4ef5dc514 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Mon, 27 Apr 2020 23:30:06 +0200 Subject: [PATCH] add 8 reserved bytes to -z protocol --- navrecv.cc | 5 +++++ nmmsender.cc | 8 ++++++-- ubxtool.cc | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/navrecv.cc b/navrecv.cc index ef11364..2d4ad0f 100644 --- a/navrecv.cc +++ b/navrecv.cc @@ -14,6 +14,7 @@ #include "zstdwrap.hh" #include "CLI/CLI.hpp" #include "version.hh" +#include static char program[]="navrecv"; @@ -141,6 +142,7 @@ void writeToDisk(time_t s, uint64_t sourceid, std::string_view message) // note that this moves the socket void recvSession2(Socket&& uns, ComboAddress client) { + string secret = SRead(uns, 8); // ignored for now cerr << "Entering compressed session for "< #include "zstdwrap.hh" - +#include using namespace std; void NMMSender::sendTCPThread(Destination* d) @@ -45,7 +45,8 @@ void NMMSender::sendTCPThread(Destination* d) }; std::unique_ptr zsc; if(d_compress) { - sc.writen("RNIE"); // the other magic value is "bert". hence. + sc.writen("RNIE00000000"); // the other magic value is "bert". hence. + // the 00000000 is a placeholder for a "secret" we might implement later zsc = std::make_unique(emit, 20); } bool hadMessage=false; @@ -111,6 +112,9 @@ void NMMSender::sendTCPThread(Destination* d) } hadMessage = false; usleep(100000); +#ifdef __linux__ + SSetsockopt(s, IPPROTO_TCP, TCP_CORK, 1 ); +#endif } } diff --git a/ubxtool.cc b/ubxtool.cc index 53524a6..b271cef 100644 --- a/ubxtool.cc +++ b/ubxtool.cc @@ -566,7 +566,7 @@ int main(int argc, char** argv) } if (doDEBUG && m8t) { cerr<