From 185ce5454e4afd11b1f90d7fe487b0ec3cb840c7 Mon Sep 17 00:00:00 2001 From: Judd Vinet Date: Mon, 17 Mar 2003 19:36:48 +0000 Subject: Imported from pacman-2.3.2.tar.gz --- libftp/ftplib.c | 18 +++++++++++++++++- libftp/ftplib.h | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'libftp') diff --git a/libftp/ftplib.c b/libftp/ftplib.c index 9089a5b3..d8c25f58 100644 --- a/libftp/ftplib.c +++ b/libftp/ftplib.c @@ -1104,7 +1104,7 @@ static int FtpXfer(const char *localfile, const char *path, if (localfile != NULL) { - char ac[4] = "w"; + char ac[4] = "a"; if (typ == FTPLIB_FILE_WRITE) ac[0] = 'r'; if (mode == FTPLIB_IMAGE) @@ -1199,6 +1199,22 @@ GLOBALDEF int FtpSize(const char *path, int *size, char mode, netbuf *nControl) return rv; } +/* + * FtpRestart - issue a REST command + * + * return 1 if successful, 0 otherwise + */ +GLOBALDEF int FtpRestart(int offset, netbuf *nControl) +{ + char cmd[256]; + int rv=1; + + sprintf(cmd,"REST %d",offset); + if (!FtpSendCmd(cmd,'3',nControl)) + rv = 0; + return rv; +} + /* * FtpModDate - determine the modification date of a remote file * diff --git a/libftp/ftplib.h b/libftp/ftplib.h index c281b723..05bdf9e1 100644 --- a/libftp/ftplib.h +++ b/libftp/ftplib.h @@ -109,6 +109,7 @@ GLOBALREF int FtpPwd(char *path, int max, netbuf *nControl); GLOBALREF int FtpNlst(const char *output, const char *path, netbuf *nControl); GLOBALREF int FtpDir(const char *output, const char *path, netbuf *nControl); GLOBALREF int FtpSize(const char *path, int *size, char mode, netbuf *nControl); +GLOBALREF int FtpRestart(int offset, netbuf *nControl); GLOBALREF int FtpModDate(const char *path, char *dt, int max, netbuf *nControl); GLOBALREF int FtpGet(const char *output, const char *path, char mode, netbuf *nControl); -- cgit v1.2.3-24-g4f1b