sftp-client.c (126274) | sftp-client.c (128456) |
---|---|
1/* 2 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * 4 * Permission to use, copy, modify, and distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 6 unchanged lines hidden (view full) --- 15 */ 16 17/* XXX: memleaks */ 18/* XXX: signed vs unsigned */ 19/* XXX: remove all logging, only return status codes */ 20/* XXX: copy between two remote sites */ 21 22#include "includes.h" | 1/* 2 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * 4 * Permission to use, copy, modify, and distribute this software for any 5 * purpose with or without fee is hereby granted, provided that the above 6 * copyright notice and this permission notice appear in all copies. 7 * 8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES --- 6 unchanged lines hidden (view full) --- 15 */ 16 17/* XXX: memleaks */ 18/* XXX: signed vs unsigned */ 19/* XXX: remove all logging, only return status codes */ 20/* XXX: copy between two remote sites */ 21 22#include "includes.h" |
23RCSID("$OpenBSD: sftp-client.c,v 1.46 2004/02/17 05:39:51 djm Exp $"); | 23RCSID("$OpenBSD: sftp-client.c,v 1.47 2004/03/03 09:30:42 djm Exp $"); |
24 25#include "openbsd-compat/sys-queue.h" 26 27#include "buffer.h" 28#include "bufaux.h" 29#include "getput.h" 30#include "xmalloc.h" 31#include "log.h" --- 768 unchanged lines hidden (view full) --- 800 return(-1); 801 } 802 803 /* Read from remote and write to local */ 804 write_error = read_error = write_errno = num_req = offset = 0; 805 max_req = 1; 806 progress_counter = 0; 807 | 24 25#include "openbsd-compat/sys-queue.h" 26 27#include "buffer.h" 28#include "bufaux.h" 29#include "getput.h" 30#include "xmalloc.h" 31#include "log.h" --- 768 unchanged lines hidden (view full) --- 800 return(-1); 801 } 802 803 /* Read from remote and write to local */ 804 write_error = read_error = write_errno = num_req = offset = 0; 805 max_req = 1; 806 progress_counter = 0; 807 |
808 if (showprogress) { 809 if (size) 810 start_progress_meter(remote_path, size, 811 &progress_counter); 812 else 813 printf("Fetching %s to %s\n", remote_path, local_path); 814 } | 808 if (showprogress && size != 0) 809 start_progress_meter(remote_path, size, &progress_counter); |
815 816 while (num_req > 0 || max_req > 0) { 817 char *data; 818 u_int len; 819 820 /* Send some more requests */ 821 while (num_req < max_req) { 822 debug3("Request range %llu -> %llu (%d/%d)", --- 208 unchanged lines hidden (view full) --- 1031 1032 startid = ackid = id + 1; 1033 data = xmalloc(conn->transfer_buflen); 1034 1035 /* Read from local and write to remote */ 1036 offset = 0; 1037 if (showprogress) 1038 start_progress_meter(local_path, sb.st_size, &offset); | 810 811 while (num_req > 0 || max_req > 0) { 812 char *data; 813 u_int len; 814 815 /* Send some more requests */ 816 while (num_req < max_req) { 817 debug3("Request range %llu -> %llu (%d/%d)", --- 208 unchanged lines hidden (view full) --- 1026 1027 startid = ackid = id + 1; 1028 data = xmalloc(conn->transfer_buflen); 1029 1030 /* Read from local and write to remote */ 1031 offset = 0; 1032 if (showprogress) 1033 start_progress_meter(local_path, sb.st_size, &offset); |
1039 else 1040 printf("Uploading %s to %s\n", local_path, remote_path); | |
1041 1042 for (;;) { 1043 int len; 1044 1045 /* 1046 * Can't use atomicio here because it returns 0 on EOF, thus losing 1047 * the last block of the file 1048 */ --- 94 unchanged lines hidden --- | 1034 1035 for (;;) { 1036 int len; 1037 1038 /* 1039 * Can't use atomicio here because it returns 0 on EOF, thus losing 1040 * the last block of the file 1041 */ --- 94 unchanged lines hidden --- |