mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-08 13:29:54 +00:00
Initialize server port in sspanel
This commit initializes the server port in sspanel.go if the userListResponse is not empty. This adds a level of preventative measure to ensure port is not left uninitialized.
This commit is contained in:
parent
4d1ed21dc7
commit
d9971b2181
@ -519,6 +519,11 @@ func (c *APIClient) ParseSSNodeResponse(nodeInfoResponse *NodeInfoResponse) (*ap
|
||||
return nil, fmt.Errorf("unmarshal %s failed: %s", reflect.TypeOf(userListResponse), err)
|
||||
}
|
||||
|
||||
// init server port
|
||||
if len(*userListResponse) != 0 {
|
||||
port = (*userListResponse)[0].Port
|
||||
}
|
||||
|
||||
if c.SpeedLimit > 0 {
|
||||
speedLimit = uint64((c.SpeedLimit * 1000000) / 8)
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user