4
Fork 0

1. Fixed issue with length field of keep-alive packet

2. Extended amount of elements in RingBuffer, reduced item length
3. Added system information into keep-alive
4. Updated version number
This commit is contained in:
R3ABM Artem 2016-08-11 09:13:10 +03:00
parent 092c1c22d4
commit 8798385d40
4 changed files with 21 additions and 13 deletions

View file

@ -17,6 +17,7 @@
#include <signal.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <sys/utsname.h>
#ifdef USE_OPENSSL
#include <openssl/sha.h>
@ -524,6 +525,9 @@ int main(int argc, const char* argv[])
0
};
struct utsname systemName;
uname(&systemName);
// Main loop
bool running = true;
@ -801,12 +805,16 @@ int main(int argc, const char* argv[])
data->number = htole32(repeaterNumber);
data->service = REWIND_SERVICE_CRONOS_AGENT;
length += sprintf(data->description, "CronosAgent " STRING(VERSION) " " BUILD);
length += sprintf(data->description,
"CronosAgent " STRING(VERSION) " %s %s " BUILD,
systemName.sysname,
systemName.machine);
outgoingBuffer->type = htole16(REWIND_TYPE_KEEP_ALIVE);
outgoingBuffer->flags = htole16(REWIND_FLAG_DEFAULT_SET);
outgoingBuffer->number = htole32(++ sequenceNumbers[0]);
outgoingBuffer->length = htobe16(length);
outgoingBuffer->length = htole16(length);
length += sizeof(struct RewindData);
sendto(uplinkHandle, outgoingBuffer, length, 0, serverAddress->ai_addr, serverAddress->ai_addrlen);

View file

@ -10,8 +10,8 @@ extern "C"
{
#endif
#define DATA_LENGTH 256
#define BUFFER_LENGTH 8
#define DATA_LENGTH 48
#define BUFFER_LENGTH 16
struct BufferRecord
{

View file

@ -1 +1 @@
#define VERSION 20160806
#define VERSION 20160811