Lines Matching refs:TG
50 #define TG(v) (tux_globals.v) macro
59 if (TG(number_vec)) { in sapi_tux_ub_write()
60 struct iovec *vec = TG(header_vec); in sapi_tux_ub_write()
62 n = TG(number_vec); in sapi_tux_ub_write()
67 if ((m = writev(TG(req)->sock, vec, n)) == -1 && errno == EPIPE) in sapi_tux_ub_write()
71 TG(req)->bytes_sent += str_length; in sapi_tux_ub_write()
73 TG(number_vec) = 0; in sapi_tux_ub_write()
80 n = send(TG(req)->sock, str, estr - str, 0); in sapi_tux_ub_write()
94 TG(req)->bytes_sent += n; in sapi_tux_ub_write()
124 TG(req)->http_status = SG(sapi_headers).http_response_code; in sapi_tux_send_headers()
126 if (TG(tux_action) == TUX_ACTION_FINISH_CLOSE_REQ && TG(req)->http_version == HTTP_1_1) in sapi_tux_send_headers()
135 TG(tux_action) = TUX_ACTION_FINISH_REQ; in sapi_tux_send_headers()
154 TG(number_vec) = n; in sapi_tux_send_headers()
155 TG(header_vec) = vec; in sapi_tux_send_headers()
167 TG(req)->objectlen = count_bytes; in sapi_tux_read_post()
168 TG(req)->object_addr = buffer; in sapi_tux_read_post()
169 if (tux(TUX_ACTION_READ_POST_DATA, TG(req))) in sapi_tux_read_post()
172 TG(read_post_data) = 1; in sapi_tux_read_post()
174 return TG(req)->objectlen; in sapi_tux_read_post()
184 return TG(req)->cookies; in sapi_tux_read_cookies()
210 p = inet_ntoa(TG(req)->client_host); in sapi_tux_register_variables()
218 snprintf(buf, sizeof(buf), "%d", CGI_SERVER_PORT(TG(req))); in sapi_tux_register_variables()
222 snprintf(buf, BUF_SIZE, "/%s", TG(hc)->pathinfo); in sapi_tux_register_variables()
225 snprintf(buf, BUF_SIZE, "/%s", TG(hc)->origfilename); in sapi_tux_register_variables()
230 if (TG(req)->field[0]) { \ in sapi_tux_register_variables()
231 php_register_variable(#name, TG(req)->field, track_vars_array TSRMLS_CC); \ in sapi_tux_register_variables()
243 if (TG(hc)->contentlength != -1) { in sapi_tux_register_variables()
244 snprintf(buf, sizeof(buf), "%ld", (long) TG(hc)->contentlength); in sapi_tux_register_variables()
250 if (TG(hc)->authorization[0]) in sapi_tux_register_variables()
322 TG(number_vec) = 0; in tux_request_ctor()
323 TG(header_vec) = NULL; in tux_request_ctor()
324 SG(request_info).query_string = strdup(TG(req)->query); in tux_request_ctor()
327 smart_str_appends_ex(&s, TG(req)->query, 1); in tux_request_ctor()
336 smart_str_appends_ex(&s, TG(req)->objectname, 1); in tux_request_ctor()
339 SG(request_info).request_method = CGI_REQUEST_METHOD(TG(req)); in tux_request_ctor()
340 if(TG(req)->http_version == HTTP_1_1) SG(request_info).proto_num = 1001; in tux_request_ctor()
343 SG(request_info).content_type = TG(req)->content_type; in tux_request_ctor()
347 php_handle_auth_data(TG(hc)->authorization TSRMLS_CC); in tux_request_ctor()
353 if (TG(header_vec)) { in tux_request_dtor()
355 free(TG(header_vec)[0].iov_base); in tux_request_dtor()
356 free(TG(header_vec)); in tux_request_dtor()
395 TG(req) = req; in TUXAPI_handle_events()
396 TG(tux_action) = TUX_ACTION_FINISH_CLOSE_REQ; in TUXAPI_handle_events()
404 return tux(TG(tux_action), req); in TUXAPI_handle_events()
409 TG(on_close) = arg; in tux_register_on_close()
416 if (TG(on_close)) TG(on_close)(fd); in tux_closed_conn()
423 return TG(req)->sock; in tux_get_fd()
430 TG(req)->event = PHP_TUX_BACKGROUND_CONN; in tux_set_dont_close()
431 tux(TUX_ACTION_POSTPONE_REQ, TG(req)); in tux_set_dont_close()
432 TG(tux_action) = TUX_ACTION_EVENTLOOP; in tux_set_dont_close()