Skip to content

Commit

Permalink
Bump versions
Browse files Browse the repository at this point in the history
new: added session id to the statistics message
updated: version number
updated: license and readme file year bump
  • Loading branch information
hfiref0x committed Jan 4, 2022
1 parent 4f1db4f commit 8454b54
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) LightFTP 2007 - 2020 Project authors
Copyright (c) LightFTP 2007 - 2022 Project authors

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,4 @@ Result binary is fftp. Next setup ftp config, example config file is Source/fftp

# Authors

(c) 2007 - 2020 LightFTP Project
(c) 2007 - 2022 LightFTP Project
13 changes: 7 additions & 6 deletions Source/ftpserv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Created on: Aug 20, 2016
*
* Modified on: Jan 3, 2022
* Modified on: Jan 4, 2022
*
* Author: lightftp
*/
Expand Down Expand Up @@ -1825,11 +1825,12 @@ void *ftp_client_thread(SOCKET *s)
pthread_mutex_destroy(&ctx.MTLock);
pthread_mutexattr_destroy(&m_attr);
snprintf(rcvbuf, sizeof(rcvbuf),
" User disconnected. \n==== Session statistics ====\n"
"Rx: %zd bytes (%f MBytes) total received by server in %zd files,\n"
"Tx: %zd bytes (%f MBytes) total sent to the client in %zd files.\n",
ctx.Stats.DataRx, ctx.Stats.DataRx/1048576.0f, ctx.Stats.FilesRx,
ctx.Stats.DataTx, ctx.Stats.DataTx/1048576.0f, ctx.Stats.FilesTx);
" User disconnected. \n==== Session %u statistics ====\n"
"Rx: %zd bytes (%f MBytes) total received by server in %zd files,\n"
"Tx: %zd bytes (%f MBytes) total sent to the client in %zd files.\n",
ctx.SessionID,
ctx.Stats.DataRx, ctx.Stats.DataRx / 1048576.0f, ctx.Stats.FilesRx,
ctx.Stats.DataTx, ctx.Stats.DataTx / 1048576.0f, ctx.Stats.FilesTx);

writelogentry(&ctx, rcvbuf, "");
break;
Expand Down
5 changes: 3 additions & 2 deletions Source/ftpserv.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Created on: Aug 20, 2016
*
* Modified on: Jan 3, 2022
* Modified on: Jan 4, 2022
*
* Author: lightftp
*/
Expand Down Expand Up @@ -61,6 +61,7 @@ typedef struct _FTP_CONFIG {
in_addr_t LocalIPMask;
} FTP_CONFIG, *PFTP_CONFIG;

#define FTP_VERSION "2.2"
#define CONFIG_FILE_NAME "fftp.conf"
#define CONFIG_SECTION_NAME "ftpconfig"
#define DEFAULT_FTP_PORT 21
Expand Down Expand Up @@ -182,7 +183,7 @@ extern const char success211[];
extern const char success214[];

#define success215 "215 UNIX Type: L8\r\n"
#define success220 "220 LightFTP server v2.2 ready\r\n"
#define success220 "220 LightFTP server ready\r\n"
#define success221 "221 Goodbye!\r\n"
#define success226 "226 Transfer complete. Closing data connection.\r\n"
#define success230 "230 User logged in, proceed.\r\n"
Expand Down
4 changes: 2 additions & 2 deletions Source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Created on: Aug 20, 2016
*
* Modified on: Jan 3, 2022
* Modified on: Jan 4, 2022
*
* Author: lightftp
*/
Expand Down Expand Up @@ -108,7 +108,7 @@ int main(int argc, char *argv[])
if (g_log != -1)
lseek(g_log, 0L, SEEK_END);

printf("\r\n [ LightFTP server v2.1 ]\r\n\r\n");
printf("\r\n [ LightFTP server v%s ]\r\n\r\n", FTP_VERSION);
printf("Log file : %s\r\n", textbuf);

p = getcwd(textbuf, bufsize);
Expand Down

0 comments on commit 8454b54

Please sign in to comment.