mirror of https://github.com/dswd/vpncloud.git
Fixed problem with growing stats file
This commit is contained in:
parent
eb620781a8
commit
44ad73701b
|
@ -7,6 +7,7 @@ This project follows [semantic versioning](http://semver.org).
|
|||
- [added] Added feature to disable special NAT support
|
||||
- [changed] Improved port forwarding on quirky routers
|
||||
- [changed] Reduced peer timeout to 5min to work better with NAT
|
||||
- [fixed] Fixed problem with growing stats file
|
||||
|
||||
### v1.2.1 (2019-12-22)
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use std::{
|
|||
fmt,
|
||||
fs::{self, File},
|
||||
hash::BuildHasherDefault,
|
||||
io::{self, Write},
|
||||
io::{self, Seek, SeekFrom, Write},
|
||||
marker::PhantomData,
|
||||
net::{SocketAddr, ToSocketAddrs},
|
||||
path::Path
|
||||
|
@ -585,6 +585,7 @@ impl<D: Device, P: Protocol, T: Table, S: Socket, TS: TimeSource> GenericCloud<D
|
|||
fn write_out_stats(&mut self) -> Result<(), io::Error> {
|
||||
if let Some(ref mut f) = self.stats_file {
|
||||
debug!("Writing out stats");
|
||||
f.seek(SeekFrom::Start(0))?;
|
||||
f.set_len(0)?;
|
||||
self.peers.write_out(f)?;
|
||||
writeln!(f)?;
|
||||
|
|
Loading…
Reference in New Issue