sent_bytes = Ns_ConnWrite(NSG(conn), (void *) str, str_length);
+ if (sent_bytes != str_length)
+ php_handle_aborted_connection();
+
return sent_bytes;
}
{
int ret;
SLS_FETCH();
- PLS_FETCH();
if (SG(server_context)) {
ret = rwrite(str, str_length, (request_rec *) SG(server_context));
ret = fwrite(str, 1, str_length, stderr);
}
if(ret != str_length) {
- PG(connection_status) = PHP_CONNECTION_ABORTED;
- if (!PG(ignore_user_abort)) {
- zend_bailout();
- }
+ php_handle_aborted_connection();
}
return ret;
}
str_length -= now;
}
if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) {
- PLS_FETCH();
- PG(connection_status) = PHP_CONNECTION_ABORTED;
-
- if (!PG(ignore_user_abort)) {
- zend_bailout();
- }
+ php_handle_aborted_connection();
}
return str_length;
b = ap_bucket_create_flush();
AP_BRIGADE_INSERT_TAIL(bb, b);
if (ap_pass_brigade(ctx->f->next, bb) != APR_SUCCESS) {
- PLS_FETCH();
- PG(connection_status) = PHP_CONNECTION_ABORTED;
-
- if (!PG(ignore_user_abort)) {
- zend_bailout();
- }
+ php_handle_aborted_connection();
}
}
static int sapi_thttpd_ub_write(const char *str, uint str_length)
{
+ int n;
TLS_FETCH();
- return send(TG(hc)->conn_fd, str, str_length, 0);
+ n = send(TG(hc)->conn_fd, str, str_length, 0);
+
+ if (n == EPIPE) {
+ php_handle_aborted_connection();
+ }
+
+ return n;
}
static int sapi_thttpd_send_headers(sapi_headers_struct *sapi_headers SLS_DC)