Lines Matching refs:hc

205 	httpd_conn* hc;
209 hc = new httpd_conn;
210 hc->initialized = 0;
213 httpd_get_conn(s->fHttpdServer, s->fHttpdServer->listen4_fd, hc);
218 httpd_destroy_conn(hc);
219 delete hc;
224 httpd_destroy_conn(hc);
234 httpd_send_err(hc, 503,
236 httpd_write_response(hc);
253 send_data(tid, 512, &hc, sizeof(httpd_conn*));
265 httpd_conn* hc;
270 if (receive_data(&sender, &hc, sizeof(httpd_conn*)) != 512)
281 setsockopt(hc->conn_fd, SOL_SOCKET, SO_RCVTIMEO, &kTimeVal,
284 hc->conn_fd,
285 &(hc->read_buf[hc->read_idx]),
286 hc->read_size - hc->read_idx,
292 hc->read_idx += retval;
293 switch(httpd_got_request(hc)) {
297 httpd_send_err(hc, 400,
299 httpd_write_response(hc);//fall through
306 if (httpd_parse_request(hc) < 0) {
307 httpd_write_response(hc);
311 retval = httpd_start_request(hc, (struct timeval*)0);
313 httpd_write_response(hc);
320 if (hc->file_address == (char*) 0) {
324 hc->conn_fd = -1;
328 switch (hc->method) {
330 s->_HandleGet(hc);
333 s->_HandleHead(hc);
336 s->_HandlePost(hc);
341 httpd_close_conn(hc, (struct timeval*)0);
342 httpd_destroy_conn(hc);
344 delete hc;
350 status_t PoorManServer::_HandleGet(httpd_conn* hc)
358 BFile file(hc->expnfilename, B_READ_ONLY);
372 log << hc->hs->cwd;
375 log << '/' << hc->expnfilename << '\n';
376 poorman_log(log.String(), true, hc->client_addr.sa_in.sin_addr.s_addr);
379 if (send(hc->conn_fd, hc->response, hc->responselen, 0) < 0) {
384 file.Seek(hc->first_byte_index, SEEK_SET);
393 if (send(hc->conn_fd, (void*)buf, bytesRead, 0) < 0) {
396 log << hc->hs->cwd;
399 log << '/' << hc->expnfilename << '\n';
400 poorman_log(log.String(), true, hc->client_addr.sa_in.sin_addr.s_addr, RED);
411 status_t PoorManServer::_HandleHead(httpd_conn* hc)
413 int retval = send(hc->conn_fd, hc->response, hc->responselen, 0);
420 status_t PoorManServer::_HandlePost(httpd_conn* hc)