📄 tilis.csp
字号:
package tilis;
import xml;
import ftps;
//import https;
function main(conf_file_name)
{
var conf_file = conf_file_name || "config.xml";
try {
var file = new node(conf_file);
if(!file.is_file) throw string.printf("%s - not found");
var p = new xml::parser();
var conf = p.parse(file.stream("rb"));
var conf_ftp = conf.child("ftp");
if(!conf_ftp) throw "xml: 'ftp' tag not found";
var conf_users = conf.child("users");
if(!conf_users) throw "xml: 'users' tag not found";
var users_map = conf_users.elements("user","name");
new thread(ftps::gatekeeper,conf_ftp,users_map);
//new thread(http::gatekeeper,conf_http,users_map);
} catch( e )
{
out.printf( "ERROR:%s.",e );
return -1;
}
var r = thread::wait();
if(is_int(r))
{
// got CTRL-C or main window closed, do shutdown...
out.printf( "quiting ");
ftps::shutdown();
while(ftps::active()) {
thread::sleep(100);
out.printf( ".");
}
out.printf( " done.");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -