add some more files to gitignore
[openblackhole/openblackhole-enigma2.git] / lib / network / http.cpp
1 #include <lib/base/init_num.h>
2 #include <lib/base/init.h>
3 #include <lib/network/http.h>
4
5 eHTTPServer *eHTTPServer::m_instance;
6
7 RESULT eHTTPServer::getDynResolver(eHTTPDynPathResolverPtr &ptr)
8 {
9         ptr = m_dyn;
10         if (!m_dyn)
11                 return -1;
12         return 0;
13 }
14
15 RESULT eHTTPServer::getFileResolver(eHTTPFilePathResolverPtr &ptr)
16 {
17         ptr = m_file;
18         if (!m_file)
19                 return -1;
20         return 0;
21 }
22
23 eHTTPServer::eHTTPServer(): m_httpd(8080, eApp)
24 {
25         m_instance = this;
26         m_dyn = new eHTTPDynPathResolver();
27         m_file = new eHTTPFilePathResolver();
28         
29         m_httpd.addResolver(m_dyn);
30         m_httpd.addResolver(m_file);
31 }
32
33 eAutoInitP0<eHTTPServer> init_eHTTPServer(eAutoInitNumbers::network, "main http server");