2009-01-25 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
Added experimental built-in HTTP server. Currently, when a client accesses to the server, it responds with the current download progress. By default, it is disabled. To enable the server, give --enable-http-server option. To change the default port number for the server to listen to, use --http-server-listen-port option. The response HTML is very simple and refreshes it self each 1 second. Because of this refresh, you see flicker in normal web browser such as Firefox. I recommend to use console-based browser such as elinks, w3m. To connect to the server, run 'elinks http://localhost:6800/' while running aria2. Please replace port number '6800'(which is default) with your preference. * src/DownloadEngineFactory.cc * src/HttpHeader.cc * src/HttpHeader.h * src/HttpHeaderProcessor.cc * src/HttpHeaderProcessor.h * src/HttpListenCommand.cc * src/HttpListenCommand.h * src/HttpServer.cc * src/HttpServer.h * src/HttpServerCommand.cc * src/HttpServerCommand.h * src/HttpServerResponseCommand.cc * src/HttpServerResponseCommand.h * src/Makefile.am * src/OptionHandlerFactory.cc * src/Util.cc * src/Util.h * src/help_tags.h * src/option_processing.cc * src/prefs.cc * src/prefs.h * src/usage_text.h * test/HttpHeaderProcessorTest.cc * test/UtilTest.cc
This commit is contained in:
@@ -51,6 +51,7 @@ class UtilTest:public CppUnit::TestFixture {
|
||||
CPPUNIT_TEST(testHttpGMT);
|
||||
CPPUNIT_TEST(testNtoh64);
|
||||
CPPUNIT_TEST(testUrlencode);
|
||||
CPPUNIT_TEST(testHtmlEscape);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
private:
|
||||
|
||||
@@ -92,6 +93,7 @@ public:
|
||||
void testHttpGMT();
|
||||
void testNtoh64();
|
||||
void testUrlencode();
|
||||
void testHtmlEscape();
|
||||
};
|
||||
|
||||
|
||||
@@ -722,4 +724,10 @@ void UtilTest::testUrlencode()
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("1%5EA%20"), Util::urlencode("1^A "));
|
||||
}
|
||||
|
||||
void UtilTest::testHtmlEscape()
|
||||
{
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("aria2<>"'util"),
|
||||
Util::htmlEscape("aria2<>\"'util"));
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
||||
Reference in New Issue
Block a user