version 1.11, 1997/02/03 01:05:40 |
version 1.12, 1997/02/05 04:55:18 |
|
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
#include <unistd.h> |
#include <unistd.h> |
|
#include <utime.h> |
#include <varargs.h> |
#include <varargs.h> |
|
|
#include "ftp_var.h" |
#include "ftp_var.h" |
|
|
int s, len, tos; |
int s, len, tos; |
static char hostnamebuf[MAXHOSTNAMELEN]; |
static char hostnamebuf[MAXHOSTNAMELEN]; |
|
|
memset((char *)&hisctladdr, 0, sizeof(hisctladdr)); |
memset((void *)&hisctladdr, 0, sizeof(hisctladdr)); |
if (inet_aton(host, &hisctladdr.sin_addr) != 0) { |
if (inet_aton(host, &hisctladdr.sin_addr) != 0) { |
hisctladdr.sin_family = AF_INET; |
hisctladdr.sin_family = AF_INET; |
(void)strncpy(hostnamebuf, host, sizeof(hostnamebuf) - 1); |
(void)strncpy(hostnamebuf, host, sizeof(hostnamebuf) - 1); |
|
|
{ |
{ |
char tmp[80]; |
char tmp[80]; |
char *user, *pass, *acct; |
char *user, *pass, *acct; |
char anonpass[MAXLOGNAME + MAXHOSTNAMELEN + 2]; /* "user@hostname\0" */ |
char anonpass[MAXLOGNAME + 1 + MAXHOSTNAMELEN]; /* "user@hostname" */ |
char hostname[MAXHOSTNAMELEN + 1]; |
char hostname[MAXHOSTNAMELEN]; |
int n, aflag = 0; |
int n, aflag = 0; |
|
|
user = pass = acct = NULL; |
user = pass = acct = NULL; |
|
|
} |
} |
|
|
void |
void |
cmdabort() |
cmdabort(notused) |
|
int notused; |
{ |
{ |
|
|
alarmtimer(0); |
alarmtimer(0); |
|
|
jmp_buf sendabort; |
jmp_buf sendabort; |
|
|
void |
void |
abortsend() |
abortsend(notused) |
|
int notused; |
{ |
{ |
|
|
alarmtimer(0); |
alarmtimer(0); |
|
|
jmp_buf recvabort; |
jmp_buf recvabort; |
|
|
void |
void |
abortrecv() |
abortrecv(notused) |
|
int notused; |
{ |
{ |
|
|
alarmtimer(0); |
alarmtimer(0); |
|
|
off_t hashbytes; |
off_t hashbytes; |
struct stat st; |
struct stat st; |
time_t mtime; |
time_t mtime; |
struct timeval tval[2]; |
|
|
|
hashbytes = mark; |
hashbytes = mark; |
direction = "received"; |
direction = "received"; |
|
|
if (preserve && (closefunc == fclose)) { |
if (preserve && (closefunc == fclose)) { |
mtime = remotemodtime(remote, 0); |
mtime = remotemodtime(remote, 0); |
if (mtime != -1) { |
if (mtime != -1) { |
(void)gettimeofday(&tval[0], |
struct utimbuf ut; |
(struct timezone *)0); |
|
tval[1].tv_sec = mtime; |
ut.actime = time(NULL); |
tval[1].tv_usec = 0; |
ut.modtime = mtime; |
if (utimes(local, tval) == -1) { |
if (utime(local, &ut) == -1) |
printf("Can't change modification time on %s to %s", |
printf("Can't change modification time on %s to %s", |
local, asctime(localtime(&mtime))); |
local, asctime(localtime(&mtime))); |
} |
|
} |
} |
} |
} |
} |
} |
|
|
} |
} |
|
|
void |
void |
psabort() |
psabort(notused) |
|
int notused; |
{ |
{ |
|
|
alarmtimer(0); |
alarmtimer(0); |
|
|
} |
} |
|
|
void |
void |
abortpt() |
abortpt(notused) |
|
int notused; |
{ |
{ |
|
|
alarmtimer(0); |
alarmtimer(0); |