search for: statbytes

Displaying 12 results from an estimated 12 matches for "statbytes".

2002 Feb 06
2
SFTP Status Bar..
...ENO, TIOCGPGRP, &ctty_pgrp) != -1 && + ctty_pgrp == pgrp)); +} + +int +getttywidth(void) +{ + struct winsize winsize; + + if (ioctl(fileno(stdout), TIOCGWINSZ, &winsize) != -1) + return (winsize.ws_col ? winsize.ws_col : 80); + else + return (80); +} + +void +progressmeter(off_t statbytes, off_t totalbytes, char *filename) +{ +#define STALLTIME 5 /* number of seconds before xfer assumed "stalled" */ + static const char prefixes[] = " KMGTP"; + static char *progressbar = NULL; + static struct timeval *start = NULL, lastupdate; + static off_t lastsize; + stat...
2002 Feb 02
0
Version two of progressbar for scp/sftp
...sion meter (from src/usr.bin/ftp/util.c) */ +static int +foregroundproc(void) +{ + static pid_t pgrp = -1; + int ctty_pgrp; + + if (pgrp == -1) + pgrp = getpgrp(); + + return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 && + ctty_pgrp == pgrp)); +} + +void +progressmeter(off_t statbytes, off_t totalbytes, char *filename) +{ +#define STALLTIME 5 /* number of seconds before xfer assumed "stalled" */ + static const char prefixes[] = " KMGTP"; + static char *progressbar = NULL, file = NULL; + static struct timeval *start = NULL, lastupdate; + static off_t las...
2002 Jan 30
1
Quick sftp status indicator.
...(from src/usr.bin/ftp/util.c) */ +static int +foregroundproc(void) +{ + static pid_t pgrp = -1; + int ctty_pgrp; + + if (pgrp == -1) + pgrp = getpgrp(); + + return ((ioctl(STDOUT_FILENO, TIOCGPGRP, &ctty_pgrp) != -1 && + ctty_pgrp == pgrp)); +} + +void +progressmeter(int flag, off_t statbytes, off_t totalbytes, char *curfile) +{ +#define STALLTIME 5 /* number of seconds before xfer assumed "stalled" */ + static const char prefixes[] = " KMGTP"; + static struct timeval lastupdate; + static off_t lastsize; + static u_char *progressbar = NULL; + static size_t prog...
2002 Jul 13
0
[PATCH]: scp program improved
...err, indx; - char *last, *name, buf[2048]; + char *last, *name, buf[2048], c; int len; + /* For rate limit */ + int buf_size, cur_mod; + long int sleep_time; - for (indx = 0; indx < argc; ++indx) { + for (indx = 0; indx < argc; ++indx) { name = argv[indx]; statbytes = 0; len = strlen(name); @@ -536,14 +581,19 @@ if (response() < 0) goto next; } + if (resume_mode) + c = 'R'; + else + c = 'C'; + #define FILEMODEMASK (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) #ifdef HAVE_LONG_LONG_INT - snpri...
2001 Apr 13
0
LFS changes...
...to transfer large (>2GB) file on a 32-bit system using LFS. Obviously, you don't want the line hard-coded in that sets _FILE_OFFSET_BIT=64, but perhaps you could make it a configure option. (Is it already perhaps?) Do you agree that these lines are neccessary or not? It does seem that statbytes (number of bytes xfer'ed so far), must be an off_t doesn't it? Thanks, Rick Niles. Scyld Computing Corporation ------------ diff -ur openssh-2.5.2p2.orig/scp.c openssh-2.5.2p2/scp.c --- openssh-2.5.2p2.orig/scp.c Sun Mar 18 22:09:40 2001 +++ openssh-2.5.2p2/scp.c Thu Apr 12 22:20:38 20...
2006 Apr 16
0
[PATCH] warning: comparison between signed and unsigned in function source@scp.c
...============================================== RCS file: /cvs/src/usr.bin/ssh/scp.c,v retrieving revision 1.141 diff -u -r1.141 scp.c --- scp.c 1 Apr 2006 05:50:29 -0000 1.141 +++ scp.c 16 Apr 2006 04:31:34 -0000 @@ -548,8 +548,7 @@ struct stat stb; static BUF buffer; BUF *bp; - off_t i, amt, statbytes; - size_t result; + off_t i, amt, statbytes, result; int fd = -1, haderr, indx; char *last, *name, buf[2048]; int len;
2002 Dec 03
1
scp "Bad address" errors with strange filesystem block sizes
...;, j ? strerror(errno) : "dropped connection"); exit(1); } amt -= j; cp += j; statbytes += j; } while (amt > 0); if (count == bp->cnt) { /* Keep reading so we stay sync'd up. */ if (wrerr == NO) { j = atomicio(write, ofd, bp-...
2017 Aug 04
4
Filter files received on scp server
Hey, So, I would be looking at type A. Forgive me if my understanding of how OpenSSH operates is not reflective of reality. I am assuming that, the file transfer is happening somewhat logically, with a name being known, content written, blah blah. >From reading scp.c, it appears that, the client end at least knows the file name so I must assume the server end must be given it. I am hoping to
2006 May 22
3
[Bug 1192] warning: comparison between signed and unsigned
http://bugzilla.mindrot.org/show_bug.cgi?id=1192 Summary: warning: comparison between signed and unsigned Product: Portable OpenSSH Version: 4.3p2 Platform: amd64 URL: http://www.openbsd.org/cgi- bin/cvsweb/src/usr.bin/ssh/scp.c.diff?r1=1.121&r2=1.122& f=h OS/Version: All
2000 Aug 18
0
[PATCH] Support symlinks in scp of openssh 2
...-289,4 +289,12 @@ main(argc, argv) IPv6 = 1; break; + case 'a': + linkflag = 1; + pflag = 1; + iamrecursive = 1; + break; + case 'L': + linkflag = 1; + break; case 'p': pflag = 1; @@ -549,12 +557,24 @@ source(argc, argv) name = argv[indx]; statbytes = 0; - if ((fd = open(name, O_RDONLY, 0)) < 0) - goto syserr; - if (fstat(fd, &stb) < 0) { + if (linkflag) { + fd = -1; + result = lstat(name, &stb); + } + else { + if ((fd = open(name, O_RDONLY, 0)) < 0) + goto syserr; + result = fstat(fd, &stb); + } + if (...
1999 Dec 14
2
1.2pre17 scp Input/Output error
Under OpenSSH 1.2pre17 I can duplicate and Input/Output error for scp: Conditions: pc36 is a RH6.0/i386 box. abc.co.za is a RH5.2/i386 box. (private network) openssh 1.2 pre 17 on both boxes. Line between them is a 128k leased line. It works between two 10baseT machines. If the scrollbar is active, the scp fails, if it isn't active, scp works. Note that without the scrollbar, the file gets
2000 Aug 24
0
patch for a few things
...ength = getttywidth() - 58; barlength = (barlength <= MAX_BARLENGTH)?barlength:MAX_BARLENGTH; if (barlength > 0) { i = barlength * ratio / 100; *************** *** 1181,1192 **** timersub(&now, &start, &td); elapsed = td.tv_sec + (td.tv_usec / 1000000.0); if (statbytes <= 0 || elapsed <= 0.0 || cursize > totalbytes) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ! " --:-- ETA"); } else if (wait.tv_sec >= STALLTIME) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), ! " - stalled -"); } else {...