pike.git / lib / modules / Tools.pmod / Standalone.pmod / httpserver.pike

version» Context lines:

pike.git/lib/modules/Tools.pmod/Standalone.pmod/httpserver.pike:21:    if(argc>1)    switch (argv[-1])    {    case "--version":    exit(0, version);    case "--help":    exit(0, doc);    default:    my_port=(int)argv[-1];    } -  Protocols.HTTP.Server.Port(handle_request, my_port); +  +  Protocols.HTTP.Server.Port(handle_request, my_port, NetUtils.ANY);    write("%s is now accessible on port %d through http, "    "without password.\n", getcwd(), my_port);    return -1;   }      string dirlist( string dir )   {    string res =    "<html><head>\n"    "<style>a { text-decoration: none; }\n"    ".odd { background-color:#efefef; }\n"    ".even { background-color:#fefefe; }\n"    "</style>\n"    "</head><body>\n"    "<h1>"+Parser.encode_html_entities(dir[2..])+"</h1>"    "<table cellspacing='0' cellpadding='2'>\n"    "<tr><th align='left'>Filename</th>"    "<th align='right'>Type</th>"    "<th align='right'>Size</th></tr>\n";    -  foreach( get_dir( dir ); int i; string fn ) +  foreach( sort( get_dir( dir ) ); int i; string fn )    {    Stdio.Stat s = file_stat( combine_path(dir, fn) );    if( !s )    continue;       string t = s->isdir?"":Protocols.HTTP.Server.filename_to_type(fn);    if( t == "application/octet-stream" )    t = "<span style='color:darkgrey'>unknown</span>";       res +=