Synchronet now requires the libarchive development package (e.g. libarchive-dev on Debian-based Linux distros, libarchive.org for more info) to build successfully.

Commit 6db10b7d authored by rswindell's avatar rswindell

DLL-exporting function ultoac (not used by ftpsrvr.c).

parent b5977c94
......@@ -93,6 +93,7 @@ static time_t uptime=0;
static DWORD served=0;
static BOOL recycle_server=FALSE;
static char revision[16];
static char *text[TOTAL_TEXT];
#ifdef _DEBUG
static BYTE socket_debug[0x10000]={0};
......@@ -1334,9 +1335,12 @@ static void send_thread(void* arg)
char buf[8192];
char fname[MAX_PATH+1];
char str[128];
char tmp[128];
int i;
int rd;
int wr;
long mod;
ulong l;
ulong total=0;
ulong last_total=0;
ulong dur;
......@@ -1349,6 +1353,7 @@ static void send_thread(void* arg)
time_t now;
time_t start;
time_t last_report;
user_t uploader;
fd_set socket_set;
struct timeval tv;
......@@ -1504,11 +1509,38 @@ static void send_thread(void* arg)
if(getfileixb(&scfg,&f)==TRUE && getfiledat(&scfg,&f)==TRUE) {
f.timesdled++;
putfiledat(&scfg,&f);
lprintf("%04d %s downloaded: %s (%lu times total)"
,xfer.ctrl_sock
,xfer.user->alias
,xfer.filename
,f.timesdled);
lprintf("%04d %s downloaded: %s (%lu times total)"
,xfer.ctrl_sock
,xfer.user->alias
,xfer.filename
,f.timesdled);
/**************************/
/* Update Uploader's Info */
/**************************/
uploader.number=matchuser(&scfg,f.uler,TRUE /*sysop_alias*/);
if(uploader.number
&& uploader.number!=xfer.user->number
&& getuserdat(&scfg,&uploader)==0
&& uploader.firston<f.dateuled) {
l=f.cdt;
if(!(scfg.dir[f.dir]->misc&DIR_CDTDL)) /* Don't give credits on d/l */
l=0;
if(scfg.dir[f.dir]->misc&DIR_CDTMIN && cps) { /* Give min instead of cdt */
mod=((ulong)(l*(scfg.dir[f.dir]->dn_pct/100.0))/cps)/60;
adjustuserrec(&scfg,uploader.number,U_MIN,10,mod);
sprintf(tmp,"%lu minute",mod);
} else {
mod=(ulong)(l*(scfg.dir[f.dir]->dn_pct/100.0));
adjustuserrec(&scfg,uploader.number,U_CDT,10,mod);
ultoac(mod,tmp);
}
/* Inform uploader of downloaded file */
sprintf(str,text[DownloadUserMsg]
,xfer.filename
,xfer.filepos ? "Partially FTP-" : "FTP-"
,xfer.user->alias,tmp);
putsmsg(&scfg,uploader.number,str);
}
}
/* Need to update datedled in index */
}
......@@ -4473,7 +4505,7 @@ void DLLCALL ftp_server(void* arg)
lprintf("Loading configuration files from %s", scfg.ctrl_dir);
scfg.size=sizeof(scfg);
SAFECOPY(error,UNKNOWN_LOAD_ERROR);
if(!load_cfg(&scfg, NULL, TRUE, error)) {
if(!load_cfg(&scfg, text, TRUE, error)) {
lprintf("!ERROR %s",error);
lprintf("!Failed to load configuration files");
cleanup(1,__LINE__);
......
......@@ -789,6 +789,8 @@ extern "C" {
DLLEXPORT ushort DLLCALL subject_crc(char *subj);
DLLEXPORT char * DLLCALL ftn_msgid(sub_t* sub, smbmsg_t* msg);
DLLEXPORT char * DLLCALL get_msgid(scfg_t* cfg, uint subnum, smbmsg_t* msg);
DLLEXPORT char * DLLCALL ultoac(ulong l,char *str);
/* date_str.c */
DLLEXPORT char * DLLCALL zonestr(short zone);
......@@ -920,7 +922,6 @@ int bstrlen(char *str);
void backslashcolon(char *str);
void backslash(char *str);
ulong ahtoul(char *str); /* Converts ASCII hex to ulong */
char * ultoac(ulong l,char *str);
char * hexplus(uint num, char *str); /* Hex plus for 3 digits up to 9000 */
uint hptoi(char *str);
int pstrcmp(char **str1, char **str2); /* Compares pointers to pointers */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment