ovpn-admin
ovpn-admin copied to clipboard
Bug - user list only show 14 users
is there any solution related with this issue ?
thanks
which version of the openvpn server and ovpn-admin do you use? And what does your setup look like?
I think it's because mgmtRead reads only 32768 bytes i fixed this problem in the following way
func (oAdmin *OvpnAdmin) mgmtRead(conn net.Conn) string {
recvData := make([]byte, 32768)
var out string
var n int -
var err error
for {
n, err = conn.Read(recvData)
if n <= 0 || err != nil {
break
} else {
out += string(recvData[:n])
if strings.Contains(out, "type 'help' for more info") || strings.Contains(out, "END") {
break
}
}
}
return out
Oh, really. we need to check it
@vitaliy-sn fyi
is it better to increase the size or loop the list?
@eatrisno In my opinion, iteration is better. with it you will not reach the limit if the list of users grows even more
noted, it is working btw I tried to increase the size and loop, both worked fine