mirror of
https://github.com/schollz/croc.git
synced 2024-11-24 08:02:33 +03:00
check if missing chunks file exists
This commit is contained in:
parent
6da93ae8da
commit
04844cf72c
@ -517,7 +517,9 @@ func (c *Client) updateState() (err error) {
|
||||
c.FilesToTransfer[c.FilesToTransferCurrentNum].Size,
|
||||
models.TCP_BUFFER_SIZE/2,
|
||||
)
|
||||
c.bar.Add(len(c.CurrentFileChunks) * models.TCP_BUFFER_SIZE / 2)
|
||||
if len(c.CurrentFileChunks) > 0 {
|
||||
c.bar.Add(len(c.CurrentFileChunks) * models.TCP_BUFFER_SIZE / 2)
|
||||
}
|
||||
bRequest, _ := json.Marshal(RemoteFileRequest{
|
||||
CurrentFileChunks: c.CurrentFileChunks,
|
||||
FilesToTransferCurrentNum: c.FilesToTransferCurrentNum,
|
||||
@ -547,7 +549,10 @@ func (c *Client) updateState() (err error) {
|
||||
progressbar.OptionSetWriter(os.Stderr),
|
||||
progressbar.OptionThrottle(100*time.Millisecond),
|
||||
)
|
||||
c.bar.Add(len(c.CurrentFileChunks) * models.TCP_BUFFER_SIZE / 2)
|
||||
log.Info(c.CurrentFileChunks)
|
||||
// if len(c.CurrentFileChunks) > 0 {
|
||||
// c.bar.Add(len(c.CurrentFileChunks) * models.TCP_BUFFER_SIZE / 2)
|
||||
// }
|
||||
c.TotalSent = 0
|
||||
for i := 1; i < len(c.Options.RelayPorts); i++ {
|
||||
go c.sendData(i)
|
||||
|
@ -119,7 +119,7 @@ func ByteCountDecimal(b int64) string {
|
||||
// If the file size is not the same as requested, it returns an empty chunk list (all chunks).
|
||||
func MissingChunks(fname string, fsize int64, chunkSize int) (chunks []int64) {
|
||||
fstat, err := os.Stat(fname)
|
||||
if fstat.Size() != fsize {
|
||||
if fstat.Size() != fsize || err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user