Пример #1
0
func putBackStatusRequestPayload(payloadInfo *statusRequestPayloadInfo) {
	transferstats.PutBack(payloadInfo.serverId, payloadInfo.transferStats)
	err := PutBackUnreportedTunnelStats(payloadInfo.tunnelStats)
	if err != nil {
		// These tunnel stats records won't be resent under after a
		// datastore re-initialization.
		NoticeAlert(
			"PutBackUnreportedTunnelStats failed: %s", ContextError(err))
	}
}
// sendStats is a helper for sending session stats to the server.
func sendStats(tunnel *Tunnel) {

	// Tunnel does not have a session when DisableApi is set
	if tunnel.session == nil {
		return
	}

	payload := transferstats.GetForServer(tunnel.serverEntry.IpAddress)
	err := tunnel.session.DoStatusRequest(payload)
	if err != nil {
		NoticeAlert("DoStatusRequest failed for %s: %s", tunnel.serverEntry.IpAddress, err)
		transferstats.PutBack(tunnel.serverEntry.IpAddress, payload)
	}
}