Lines Matching refs:hc
44 httpd_conn *hc; member
78 PHP_SYS_CALL(n = send(TG(hc)->conn_fd, str, str_length, 0);); in sapi_thttpd_ub_write()
89 TG(hc)->bytes_sent += n; in sapi_thttpd_ub_write()
113 PHP_SYS_CALL(n = writev(TG(hc)->conn_fd, vec, nvec);); in do_writev()
124 TG(hc)->bytes_sent += n; in do_writev()
193 TG(hc)->status = SG(sapi_headers).http_response_code; in sapi_thttpd_send_headers()
223 if (TG(seen_cl) && !TG(seen_cn) && TG(hc)->do_keep_alive) { in sapi_thttpd_send_headers()
226 TG(hc)->do_keep_alive = 0; in sapi_thttpd_send_headers()
244 #define SIZEOF_UNCONSUMED_BYTES() (TG(hc)->read_idx - TG(hc)->checked_idx)
245 #define CONSUME_BYTES(n) do { TG(hc)->checked_idx += (n); } while (0)
254 memcpy(buffer, TG(hc)->read_buf + TG(hc)->checked_idx, read_bytes); in sapi_thttpd_read_post()
264 return TG(hc)->cookie; in sapi_thttpd_read_cookies()
284 if (TG(hc)->one_one) { in sapi_thttpd_register_variables()
290 p = httpd_ntoa(&TG(hc)->client_addr); in sapi_thttpd_register_variables()
297 TG(hc)->hs->port)); in sapi_thttpd_register_variables()
300 memcpy(buf + 1, TG(hc)->pathinfo, strlen(TG(hc)->pathinfo) + 1); in sapi_thttpd_register_variables()
304 memcpy(buf + 1, TG(hc)->origfilename, strlen(TG(hc)->origfilename) + 1); in sapi_thttpd_register_variables()
308 if (TG(hc)->field[0]) { \ in sapi_thttpd_register_variables()
309 php_register_variable(#name, TG(hc)->field, track_vars_array TSRMLS_CC); \ in sapi_thttpd_register_variables()
324 if (TG(hc)->contentlength != -1) { in sapi_thttpd_register_variables()
327 TG(hc)->contentlength)); in sapi_thttpd_register_variables()
330 if (TG(hc)->authorization[0]) in sapi_thttpd_register_variables()
367 if (nfd) *nfd = TG(hc)->conn_fd;
442 SG(request_info).query_string = TG(hc)->query?strdup(TG(hc)->query):NULL;
444 smart_str_appends_ex(&s, TG(hc)->hs->cwd, 1);
445 smart_str_appends_ex(&s, TG(hc)->expnfilename, 1);
451 smart_str_appends_ex(&s, TG(hc)->origfilename, 1);
454 SG(request_info).request_method = httpd_method_str(TG(hc)->method);
455 if (TG(hc)->one_one) SG(request_info).proto_num = 1001;
458 if (TG(hc)->contenttype)
459 SG(request_info).content_type = strdup(TG(hc)->contenttype);
460 SG(request_info).content_length = TG(hc)->contentlength == -1 ? 0
461 : TG(hc)->contentlength;
465 php_handle_auth_data(TG(hc)->authorization TSRMLS_CC);
494 httpd_conn *hc; member
523 static httpd_conn *duplicate_conn(httpd_conn *hc, httpd_conn *nhc) argument
525 memcpy(nhc, hc, sizeof(*nhc));
534 static void destroy_conn(httpd_conn *hc) argument
536 #define HANDLE_STR(m) if (hc->m) free(hc->m)
549 ret = m->hc;
561 static void queue_request(httpd_conn *hc) argument
567 hc->file_address = (char *) 1;
574 duplicate_conn(hc, nhc);
578 m->hc = nhc;
598 static off_t thttpd_real_php_request(httpd_conn *hc, int TSRMLS_DC);
603 httpd_conn *hc; local
606 hc = dequeue_request();
608 if (!hc) {
617 thttpd_real_php_request(hc, 0 TSRMLS_CC);
618 shutdown(hc->conn_fd, 0);
619 destroy_conn(hc);
620 free(hc);
636 if (m->hc->conn_fd == fd) {
643 destroy_conn(m->hc);
644 free(m->hc);
656 static off_t thttpd_real_php_request(httpd_conn *hc, int show_source TSRMLS_DC) argument
658 TG(hc) = hc;
659 hc->bytes_sent = 0;
661 if (hc->contentlength != -1) {
662 hc->should_linger = 1;
663 hc->do_keep_alive = 0;
666 if (hc->contentlength != -1
667 && SIZEOF_UNCONSUMED_BYTES() < hc->contentlength) {
668 hc->read_body_into_mem = 1;
678 TG(hc)->do_keep_alive = 0;
682 if (TG(hc)->response)
683 free(TG(hc)->response);
685 TG(hc)->response = TG(sbuf).c;
686 TG(hc)->responselen = TG(sbuf).len;
687 TG(hc)->maxresponse = TG(sbuf).a;
699 off_t thttpd_php_request(httpd_conn *hc, int show_source) argument
702 queue_request(hc);
705 return thttpd_real_php_request(hc, show_source TSRMLS_CC);
724 return TG(hc)->conn_fd;
731 TG(hc)->file_address = (char *) 1;