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

+2 -2
View File
@@ -834,9 +834,9 @@ var inputStructs = []*structInfo{
inProto: &sessions.Connection{},
outFile: "sessions/connection.gen.go",
fieldOverrides: []fieldInfo{
// uint64 fields get marshalled by protobuf as strings, so we have
// int64 fields get marshalled by protobuf as strings, so we have
// to tell the json parser that their json representation is a
// string but they go into Go uint64 types.
// string but they go into Go int64 types.
{Name: "BytesUp", JsonTags: []string{"string"}},
{Name: "BytesDown", JsonTags: []string{"string"}},
},