This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
if metaPkt.Magic == nncp.MagicNNCPMv1.B {
ctx.LogE("reass", les, nncp.MagicNNCPMv1.TooOld(), logMsg)
return false
if metaPkt.Magic == nncp.MagicNNCPMv1.B {
ctx.LogE("reass", les, nncp.MagicNNCPMv1.TooOld(), logMsg)
return false
}
hsh = nncp.MTHNew(fi.Size(), 0)
if _, err = nncp.CopyProgressed(
}
hsh = nncp.MTHNew(fi.Size(), 0)
if _, err = nncp.CopyProgressed(
- hsh, bufio.NewReader(fd), "check",
+ hsh, bufio.NewReaderSize(fd, nncp.MTHBlockSize), "check",
nncp.LEs{{K: "Pkt", V: chunkPath}, {K: "FullSize", V: fi.Size()}},
ctx.ShowPrgrs,
); err != nil {
log.Fatalln(err)
}
nncp.LEs{{K: "Pkt", V: chunkPath}, {K: "FullSize", V: fi.Size()}},
ctx.ShowPrgrs,
); err != nil {
log.Fatalln(err)
}
log.Fatalln("Can not stat file:", err)
}
if _, err = nncp.CopyProgressed(
log.Fatalln("Can not stat file:", err)
}
if _, err = nncp.CopyProgressed(
- dstW, bufio.NewReader(fd), "reass",
+ dstW, bufio.NewReaderSize(fd, nncp.MTHBlockSize), "reass",
nncp.LEs{{K: "Pkt", V: chunkPath}, {K: "FullSize", V: fi.Size()}},
ctx.ShowPrgrs,
); err != nil {
log.Fatalln(err)
}
nncp.LEs{{K: "Pkt", V: chunkPath}, {K: "FullSize", V: fi.Size()}},
ctx.ShowPrgrs,
); err != nil {
log.Fatalln(err)
}
- if err = tmp.Sync(); err != nil {
- log.Fatalln("Can not sync:", err)
+ if !nncp.NoSync {
+ if err = tmp.Sync(); err != nil {
+ log.Fatalln("Can not sync:", err)
+ }
}
if err = tmp.Close(); err != nil {
log.Fatalln("Can not close:", err)
}
if err = tmp.Close(); err != nil {
log.Fatalln("Can not close:", err)
if err != nil {
ctx.LogE("reass", nncp.LEs{{K: "Path", V: dirPath}}, err, logMsg)
return nil
if err != nil {
ctx.LogE("reass", nncp.LEs{{K: "Path", V: dirPath}}, err, logMsg)
return nil