MCPcopy Create free account
hub / github.com/acl-dev/acl / start

Method start

lib_acl_cpp/src/http/HttpServlet.cpp:137–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

135}
136
137bool HttpServlet::start(void)
138{
139 socket_stream* in;
140 socket_stream* out;
141 bool cgi_mode;
142
143 bool first = first_;
144 if (first_) {
145 first_ = false;
146 }
147
148 if (stream_ == NULL) {
149 // ������Ϊ�գ��� CGI ģʽ����������׼�������
150 // ��������
151 in = NEW socket_stream();
152 in->open(ACL_VSTREAM_IN);
153
154 out = NEW socket_stream();
155 out->open(ACL_VSTREAM_OUT);
156 cgi_mode = true;
157 } else {
158 in = out = stream_;
159 cgi_mode = false;
160 }
161
162 // �� HTTP �������ظ���������£��Է���һ����Ҫ����ɾ������/��Ӧ����
163 delete req_;
164 delete res_;
165
166 res_ = NEW HttpServletResponse(*out);
167 req_ = NEW HttpServletRequest(*res_, session_, *in, local_charset_,
168 parse_body_limit_);
169 req_->setParseBody(parse_body_);
170
171 // ���� HttpServletRequest ����
172 res_->setHttpServletRequest(req_);
173
174 if (rw_timeout_ >= 0) {
175 req_->setRwTimeout(rw_timeout_);
176 }
177
178 res_->setCgiMode(cgi_mode);
179
180 string method_s(32);
181 http_method_t method = req_->getMethod(&method_s);
182
183 // ���������ֵ�Զ��趨�Ƿ���Ҫ���ֳ�����
184 if (!cgi_mode) {
185 res_->setKeepAlive(req_->isKeepAlive());
186 }
187
188 bool ret;
189
190 switch (method) {
191 case HTTP_METHOD_GET:
192 // �����ó��Ծɷ�����־Ϊ false������û�δʵ�ֵ�ǰ�鷽������
193 // ����û����鷽���������л����øñ�־Ϊ true���Ӷ��ٳ���ʹ��
194 // �ɵ���ӿڣ���������Ҫ��Ϊ����ʷ���������ء�

Callers

nothing calls this directly

Calls 15

upgradeWebsocketFunction · 0.85
setParseBodyMethod · 0.80
setHttpServletRequestMethod · 0.80
setRwTimeoutMethod · 0.80
getMethodMethod · 0.80
isKeepAliveMethod · 0.80
sendHeaderMethod · 0.80
socket_streamClass · 0.50
HttpServletResponseClass · 0.50
HttpServletRequestClass · 0.50
last_serrorFunction · 0.50
openMethod · 0.45

Tested by

no test coverage detected