Lines 340-346
Link Here
|
340 |
} |
340 |
} |
341 |
else if (str_equal_text(&p_sess->ftp_cmd_str, "OPTS")) |
341 |
else if (str_equal_text(&p_sess->ftp_cmd_str, "OPTS")) |
342 |
{ |
342 |
{ |
343 |
vsf_cmdio_write(p_sess, FTP_BADOPTS, "Option not understood."); |
343 |
if (tunable_charset_filter_enable) |
|
|
344 |
{ |
345 |
handle_opts(p_sess); |
346 |
} |
347 |
else |
348 |
{ |
349 |
vsf_cmdio_write(p_sess, FTP_BADOPTS, "Option not understood."); |
350 |
} |
344 |
} |
351 |
} |
345 |
else if (str_equal_text(&p_sess->ftp_cmd_str, "STAT") && |
352 |
else if (str_equal_text(&p_sess->ftp_cmd_str, "STAT") && |
346 |
str_isempty(&p_sess->ftp_arg_str)) |
353 |
str_isempty(&p_sess->ftp_arg_str)) |
Lines 1702-1707
Link Here
|
1702 |
} |
1709 |
} |
1703 |
} |
1710 |
} |
1704 |
|
1711 |
|
|
|
1712 |
handle_opts(struct vsf_session* p_sess) |
1713 |
{ |
1714 |
struct mystr opts = INIT_MYSTR; |
1715 |
struct mystr prm = INIT_MYSTR; |
1716 |
|
1717 |
str_copy(&opts, &p_sess->ftp_arg_str); |
1718 |
str_upper(&opts); |
1719 |
str_split_char(&opts, &prm, ' '); |
1720 |
|
1721 |
if (str_equal_text(&opts, "UTF8")) |
1722 |
{ |
1723 |
if (str_equal_text(&prm, "ON")) |
1724 |
{ |
1725 |
tunable_charset_client=vsf_sysutil_strdup("UTF8"); |
1726 |
vsf_cmdio_write(p_sess, FTP_OPTSOK, "UTF8 option is On."); |
1727 |
} |
1728 |
else |
1729 |
if (str_equal_text(&prm, "OFF")) |
1730 |
{ |
1731 |
vsf_cmdio_write(p_sess, FTP_OPTSOK, "UTF8 option is Off."); |
1732 |
} |
1733 |
else |
1734 |
{ |
1735 |
vsf_cmdio_write(p_sess, FTP_BADOPTS, "Invalid UTF8 option."); |
1736 |
} |
1737 |
} |
1738 |
} |
1705 |
static void |
1739 |
static void |
1706 |
handle_stat(struct vsf_session* p_sess) |
1740 |
handle_stat(struct vsf_session* p_sess) |
1707 |
{ |
1741 |
{ |
Lines 1764-1769
Link Here
|
1764 |
vsf_cmdio_write_raw(p_sess, vsf_sysutil_ulong_to_str(p_sess->num_clients)); |
1798 |
vsf_cmdio_write_raw(p_sess, vsf_sysutil_ulong_to_str(p_sess->num_clients)); |
1765 |
vsf_cmdio_write_raw(p_sess, "\r\n"); |
1799 |
vsf_cmdio_write_raw(p_sess, "\r\n"); |
1766 |
} |
1800 |
} |
|
|
1801 |
|
1802 |
if (tunable_charset_filter_enable) |
1803 |
{ |
1804 |
vsf_cmdio_write_raw(p_sess, " Server charset is "); |
1805 |
vsf_cmdio_write_raw(p_sess, tunable_charset_server); |
1806 |
vsf_cmdio_write_raw(p_sess, "\r\n"); |
1807 |
vsf_cmdio_write_raw(p_sess, " Remote charset is "); |
1808 |
vsf_cmdio_write_raw(p_sess, tunable_charset_client); |
1809 |
vsf_cmdio_write_raw(p_sess, "\r\n"); |
1810 |
/* vsf_cmdio_write_raw(p_sess, " Char convertion is "); |
1811 |
* if (p_sess->enable_convertion) |
1812 |
* { |
1813 |
* vsf_cmdio_write_raw(p_sess, "on"); |
1814 |
* } |
1815 |
* else |
1816 |
* { |
1817 |
* vsf_cmdio_write_raw(p_sess, "off"); |
1818 |
* } |
1819 |
* vsf_cmdio_write_raw(p_sess, "\r\n"); |
1820 |
*/ |
1821 |
} |
1767 |
vsf_cmdio_write_raw(p_sess, |
1822 |
vsf_cmdio_write_raw(p_sess, |
1768 |
" vsFTPd " VSF_VERSION " - secure, fast, stable\r\n"); |
1823 |
" vsFTPd " VSF_VERSION " - secure, fast, stable\r\n"); |
1769 |
vsf_cmdio_write(p_sess, FTP_STATOK, "End of status"); |
1824 |
vsf_cmdio_write(p_sess, FTP_STATOK, "End of status"); |