Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
kojidev committed Dec 12, 2024
1 parent 38c857a commit 4db963e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions runtime/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ static void header(const char *str, int str_len, bool replace = true, int http_r
}

bool f$headers_sent() {
return headers_sent;
return false;
}

void f$header(const string &str, bool replace, int64_t http_response_code) {
Expand Down Expand Up @@ -572,11 +572,9 @@ static int ob_merge_buffers() {
void f$flush() {
php_assert(ob_cur_buffer >= 0 && php_worker.has_value());
// Run custom headers handler before body processing
if (!headers_sent && query_type == QUERY_TYPE_HTTP) {
if (headers_custom_handler_function && !headers_sent && query_type == QUERY_TYPE_HTTP) {
headers_sent = true;
if (headers_custom_handler_function) {
headers_custom_handler_function();
}
headers_custom_handler_function();
}
string_buffer const * http_body = compress_http_query_body(&oub[ob_system_level]);
string_buffer const * http_headers = nullptr;
Expand All @@ -592,11 +590,9 @@ void f$flush() {

void f$fastcgi_finish_request(int64_t exit_code) {
// Run custom headers handler before body processing
if (!headers_sent && query_type == QUERY_TYPE_HTTP) {
if (headers_custom_handler_function && !headers_sent && query_type == QUERY_TYPE_HTTP) {
headers_sent = true;
if (headers_custom_handler_function) {
headers_custom_handler_function();
}
headers_custom_handler_function();
}
int ob_total_buffer = ob_merge_buffers();
if (php_worker.has_value() && php_worker->flushed_http_connection) {
Expand Down

0 comments on commit 4db963e

Please sign in to comment.