The log like: ocserv[20032]: GnuTLS error (at worker-vpn.c:1177): The TLS connection was non-properly terminated. ocserv[19871]: main:x.x.x.x:58880 main-misc.c:396: command socket closed ocserv[19871]: main:x.x.x.x:58880 removing client 'user1' with id '20032' ocserv[20060]: main:x.x.x.x:58880 executing script /opt/ocserv/etc/ocserv-script ifconfig shows: RX bytes:95684 (93.4 KiB) TX bytes:262014 (255.8 KiB) script very simple: #!/bin/bash if [ "$REASON" = "connect" ];then echo "User '$USERNAME' from '$IP_REAL' connected. Local IP is '$IP_REMOTE'" >> /tmp/1 else echo "User '$USERNAME' from '$IP_REAL' disconnected." >> /tmp/1 echo $STATS_BYTES_IN, out: $STATS_BYTES_OUT >> /tmp/1 fi exit 0 On Sun, May 4, 2014 at 7:38 PM, Nikos Mavrogiannopoulos <nmav at gnutls.org> wrote: > On Sun, 2014-05-04 at 18:48 +0800, Steve wrote: >> Latest git head now report correct bytes when manually turn on/off in >> client, but when iOS goes into screen lock, AnyConnect client >> disconnect VPN, the disconnect script still got 0 0. > > I don't see that. Could you provide the output of -d 1, the output of > the disconnect script (you can use ocserv-script which prints the stats > values), as well as how you sent data. > > regards, > Nikos > >