Atomic connection stats updates

This commit is contained in:
Jakob Borg
2013-12-30 09:53:54 -05:00
parent bceacf04ca
commit 005b207737
3 changed files with 39 additions and 26 deletions

View File

@@ -50,7 +50,7 @@ func (w *marshalWriter) writeIndex(idx []FileInfo) {
func WriteIndex(w io.Writer, idx []FileInfo) (int, error) {
mw := marshalWriter{w: w}
mw.writeIndex(idx)
return mw.tot, mw.err
return int(mw.getTot()), mw.err
}
func (w *marshalWriter) writeRequest(r request) {