Subversion Repositories SvarDOS

Rev

Rev 332 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 332 Rev 333
Line 206... Line 206...
206
        }
206
        }
207
        flen += byteread;
207
        flen += byteread;
208
        /* update progress once a sec */
208
        /* update progress once a sec */
209
        if (lastprogressoutput != lastactivity) {
209
        if (lastprogressoutput != lastactivity) {
210
          lastprogressoutput = lastactivity;
210
          lastprogressoutput = lastactivity;
211
          printf("%ld KiB (%ld KiB/s)\r", flen >> 10, (flen >> 10) - (lastflen >> 10));
211
          printf("%ld KiB (%ld KiB/s)     \r", flen >> 10, (flen >> 10) - (lastflen >> 10)); /* trailing spaces are meant to avoid leaving garbage on screen if speed goes from, say, 1000 KiB/s to 9 KiB/s */
212
          lastflen = flen;
212
          lastflen = flen;
213
          fflush(stdout); /* avoid console buffering */
213
          fflush(stdout); /* avoid console buffering */
214
        }
214
        }
215
        /* update the bsd sum */
215
        /* update the bsd sum */
216
        for (i = 0; i < byteread; i++) {
216
        for (i = 0; i < byteread; i++) {
Line 227... Line 227...
227
  }
227
  }
228
  net_close(sock);
228
  net_close(sock);
229
  return(flen);
229
  return(flen);
230
 
230
 
231
  SHITQUIT:
231
  SHITQUIT:
232
  net_abort(sock);
232
  net_close(sock);
233
  return(-1);
233
  return(-1);
234
}
234
}
235
 
235
 
236
 
236
 
237
/* checks if file exists, returns 0 if not, non-zero otherwise */
237
/* checks if file exists, returns 0 if not, non-zero otherwise */