Newer
Older
#endif
pgrsDone(data);
/* shut down the socket to inform the server we're done */
sclose(data->secondarysocket);
data->secondarysocket = -1;
/* now let's see what the server says about the transfer we
just performed: */
nread = GetLastResponse(data->firstsocket, buf, data);
/* 226 Transfer complete */
if(strncmp(buf, "226", 3)) {
failf(data, "%s", buf+4);
return URG_FTP_WRITE_ERROR;
}
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
/* Send any post-transfer QUOTE strings? */
if(data->postquote) {
qitem = data->postquote;
/* Send all QUOTE strings in same order as on command-line */
while (qitem) {
/* Send string */
if (qitem->data) {
sendf(data->firstsocket, data, "%s\r\n", qitem->data);
nread = GetLastResponse(data->firstsocket, buf, data);
if (buf[0] != '2') {
failf(data, "QUOT string not accepted: %s",
qitem->data);
return URG_FTP_QUOTE_ERROR;
}
}
qitem = qitem->next;
}
}
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
return URG_OK;
}
/* -- deal with the ftp server! -- */
UrgError ftp(struct UrlData *data,
long *bytecountp,
char *ftpuser,
char *ftppasswd,
char *urlpath)
{
char *realpath;
UrgError retcode;
#if 0
realpath = URLfix(urlpath);
#else
realpath = curl_unescape(urlpath);
#endif
if(realpath) {
retcode = _ftp(data, bytecountp, ftpuser, ftppasswd, realpath);
free(realpath);
}
else
/* then we try the original path */
retcode = _ftp(data, bytecountp, ftpuser, ftppasswd, urlpath);
return retcode;
}