fix(connection): Make bytes up and down a signed 64-bit integer

This fixes a theoretical issue with database interaction. Because the
fields in the database are signed 64-bit integers, it's theoretically
possible to overflow them if we're using unsigned 64-bit integers in the
application code.
This commit is contained in:
Hugo Vieira committed 2022-10-26 17:44:28 +01:00
1 parent c81398cbf3
commit d206635d74
17 files changed
+57 -57

No files matched your search

@@ -33,10 +33,10 @@ message Connection {
uint32 endpoint_tcp_port = 6; // @gotags: `class:"public"`
// bytes_up of the connection
uint64 bytes_up = 7; // @gotags: `class:"public"`
int64 bytes_up = 7; // @gotags: `class:"public"`
// bytes_down of the connection
uint64 bytes_down = 8; // @gotags: `class:"public"`
int64 bytes_down = 8; // @gotags: `class:"public"`
// closed_reason of the connection
string closed_reason = 9; // @gotags: `class:"public"`
@@ -26,8 +26,8 @@ enum CONNECTIONSTATUS {
message Connection {
string connection_id = 1; // @gotags: `class:"public"`
CONNECTIONSTATUS status = 2;
uint64 bytes_up = 3; // @gotags: `class:"public"`
uint64 bytes_down = 4; // @gotags: `class:"public"`
int64 bytes_up = 3; // @gotags: `class:"public"`
int64 bytes_down = 4; // @gotags: `class:"public"`
}
enum SESSIONSTATUS {
@@ -109,8 +109,8 @@ message ConnectConnectionResponse {
message CloseConnectionRequestData {
string connection_id = 10; // @gotags: `class:"public"`
uint64 bytes_up = 20; // @gotags: `class:"public"`
uint64 bytes_down = 30; // @gotags: `class:"public"`
int64 bytes_up = 20; // @gotags: `class:"public"`
int64 bytes_down = 30; // @gotags: `class:"public"`
string reason = 40; // @gotags: `class:"public"`
}