/* XXX: copy between two remote sites */
#include "includes.h"
-RCSID("$OpenBSD: sftp-client.c,v 1.56 2005/07/17 07:17:55 djm Exp $");
+RCSID("$OpenBSD: sftp-client.c,v 1.60 2006/02/20 17:19:54 stevesk Exp $");
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+# include <signal.h>
#include "openbsd-compat/sys-queue.h"
extern volatile sig_atomic_t interrupted;
extern int showprogress;
-/* Minimum amount of data to read at at time */
+/* Minimum amount of data to read at a time */
#define MIN_READ_SIZE 512
-/* Maximum packet size */
-#define MAX_MSG_LENGTH (256 * 1024)
-
struct sftp_conn {
int fd_in;
int fd_out;
{
u_char mlen[4];
- if (buffer_len(m) > MAX_MSG_LENGTH)
+ if (buffer_len(m) > SFTP_MAX_MSG_LENGTH)
fatal("Outbound message too long %u", buffer_len(m));
/* Send length first */
}
msg_len = buffer_get_int(m);
- if (msg_len > MAX_MSG_LENGTH)
+ if (msg_len > SFTP_MAX_MSG_LENGTH)
fatal("Received message too long %u", msg_len);
buffer_append_space(m, msg_len);
Attrib junk, *a;
Buffer msg;
char *handle;
- int local_fd, status, write_error;
+ int local_fd, status = 0, write_error;
int read_error, write_errno;
u_int64_t offset, size;
u_int handle_len, mode, type, id, buflen, num_req, max_req;