]> Cypherpunks.ru repositories - govpn.git/commitdiff
Align statistics counters for correct sync.atomic work on 32-bit systems
authorSergey Matveev <stargrave@stargrave.org>
Sat, 6 Feb 2016 11:04:00 +0000 (14:04 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 6 Feb 2016 11:08:56 +0000 (14:08 +0300)
Signed-off-by: Sergey Matveev <stargrave@stargrave.org>
VERSION
doc/news.ru.texi
doc/news.texi
src/cypherpunks.ru/govpn/peer.go

diff --git a/VERSION b/VERSION
index 37c2d9960ec72414b3941f8f4c1172fb6e3c6e7f..9ad974f6109e4bf8a9c47b6d1870e2b4990d9841 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5.4
+5.5
index 980cace9cd5d73a65180f5921ceb59cfe6f51116..23aac4e6ced4fbc216fc9edca350cd7d93276285 100644 (file)
@@ -2,6 +2,7 @@
 @section Новости
 
 @menu
+* Релиз 5.5::
 * Релиз 5.4::
 * Релиз 5.3::
 * Релиз 5.2::
 * Релиз 1.0::
 @end menu
 
+@node Релиз 5.5
+@subsection Релиз 5.5
+@itemize
+@item Возможность работы на 32-х битных платформах. @emph{sync/atomic}
+библиотека имеет особенности из-за которых предыдущие версии паниковали.
+@end itemize
+
 @node Релиз 5.4
 @subsection Релиз 5.4
 @itemize
index c96fdb9fc5674d16301ece4fcb7d2c82a033318f..4aaa695c09e741e1b426f50def302171310a872a 100644 (file)
@@ -4,6 +4,7 @@
 See also this page @ref{Новости, on russian}.
 
 @menu
+* Release 5.5::
 * Release 5.4::
 * Release 5.3::
 * Release 5.2::
@@ -30,6 +31,13 @@ See also this page @ref{Новости, on russian}.
 * Release 1.0::
 @end menu
 
+@node Release 5.5
+@section Release 5.5
+@itemize
+@item Ability to work on 32-bit platforms. @emph{sync/atomic} library
+has some specific issues that caused panics on previous versions.
+@end itemize
+
 @node Release 5.4
 @section Release 5.4
 @itemize
index 4b48cec43ee983f082de34d8569ec8133d56dc1b..a9c0aaae8dbe386dad397e2df97aaea3a7ee9d03 100644 (file)
@@ -64,6 +64,19 @@ func newNonceCipher(key *[32]byte) *xtea.Cipher {
 }
 
 type Peer struct {
+       // Statistics (they are at the beginning for correct int64 alignment)
+       BytesIn         uint64
+       BytesOut        uint64
+       BytesPayloadIn  uint64
+       BytesPayloadOut uint64
+       FramesIn        uint64
+       FramesOut       uint64
+       FramesUnauth    uint64
+       FramesDup       uint64
+       HeartbeatRecv   uint64
+       HeartbeatSent   uint64
+
+       // Basic
        Addr string
        Id   *PeerId
        Conn io.Writer
@@ -95,18 +108,6 @@ type Peer struct {
        LastSent      time.Time
        willSentCycle time.Time
 
-       // Statistics
-       BytesIn         uint64
-       BytesOut        uint64
-       BytesPayloadIn  uint64
-       BytesPayloadOut uint64
-       FramesIn        uint64
-       FramesOut       uint64
-       FramesUnauth    uint64
-       FramesDup       uint64
-       HeartbeatRecv   uint64
-       HeartbeatSent   uint64
-
        // Receiver
        BusyR    sync.Mutex `json:"-"`
        bufR     []byte