3 #include "ace/OS_NS_stdlib.h"
4 #include "HTTP_Config.h"
6 // static HTTP_Config_Info config_info;
8 HTTP_Config_Info
*HTTP_Config::instance_
= 0;
11 HTTP_Config::instance ()
13 if (HTTP_Config::instance_
== 0)
15 HTTP_Config::instance_
= new HTTP_Config_Info
;
17 HTTP_Config::instance_
->document_root (0);
18 HTTP_Config::instance_
->cgi_path (0);
19 HTTP_Config::instance_
->user_dir (0);
20 HTTP_Config::instance_
->dir_index (0);
21 HTTP_Config::instance_
->proxy_flag (0);
24 return HTTP_Config::instance_
;
27 HTTP_Config_Info::HTTP_Config_Info ()
36 HTTP_Config_Info::~HTTP_Config_Info ()
41 HTTP_Config_Info::document_root () const
43 return this->document_root_
;
47 HTTP_Config_Info::cgi_path () const
49 return this->cgi_path_
;
53 HTTP_Config_Info::user_dir () const
55 return this->user_dir_
;
59 HTTP_Config_Info::dir_index () const
61 return this->dir_index_
;
65 HTTP_Config_Info::proxy_flag () const
67 return this->proxy_flag_
;
71 HTTP_Config_Info::document_root (const char *dr_string
)
74 this->document_root_
= dr_string
;
77 this->document_root_
= ACE_OS::getenv ("JAWS_DOCUMENT_ROOT");
78 if (!this->document_root_
)
79 this->document_root_
= ".";
82 return this->document_root_
;
86 HTTP_Config_Info::cgi_path (const char *cp_string
)
89 this->cgi_path_
= cp_string
;
92 this->cgi_path_
= ACE_OS::getenv ("JAWS_CGI_PATH");
95 this->cgi_path_
= "cgi-bin";
98 return this->cgi_path_
;
102 HTTP_Config_Info::user_dir (const char *ud_string
)
105 this->user_dir_
= ud_string
;
108 this->user_dir_
= ACE_OS::getenv ("JAWS_USER_DIR");
109 if (!this->user_dir_
)
110 this->user_dir_
= ".www";
113 return this->user_dir_
;
117 HTTP_Config_Info::dir_index (const char *di_string
)
120 this->dir_index_
= di_string
;
123 this->dir_index_
= ACE_OS::getenv ("JAWS_DIR_INDEX");
124 if (!this->dir_index_
)
125 this->dir_index_
= "index.html";
128 return this->dir_index_
;
132 HTTP_Config_Info::proxy_flag (int pf
)
134 this->proxy_flag_
= pf
;
135 return this->proxy_flag_
;