ecb = (LPEXTENSION_CONTROL_BLOCK) SG(server_context);
if (ecb->WriteClient(ecb->ConnID, (char *) str, &num_bytes, HSE_IO_SYNC ) == FALSE) {
- zend_bailout();
+ php_handle_aborted_connection();
}
return num_bytes;
}
rc = (nsapi_request_context *)SG(server_context);
retval = net_write(rc->sn->csd, (char *)str, str_length);
if (retval == IO_ERROR /*-1*/ || retval == IO_EOF /*0*/)
- return -1;
- else
- return retval;
+ php_handle_aborted_connection();
+ return retval;
}
static int
sent_bytes = fd_write(PHG(cip)->fd,str,str_length);
- if (sent_bytes == -1) perror("fd_write\n");
+ if (sent_bytes == -1) {
+ php_handle_aborted_connection();
+ }
return sent_bytes;
}
if ( !IWasLoaded ) return 0;
cb->WriteClient(cb->ConnID, (char *) str, &num_bytes, 0 );
+
+ if (num_bytes != str_length)
+ php_handle_aborted_connection();
return num_bytes;
}
pop_stack();
if(sent_bytes != str_length) {
/* This means the connection is closed. Dead. Gone. *sniff* */
- PG(connection_status) = PHP_CONNECTION_ABORTED;
- zend_bailout();
+ php_handle_aborted_connection();
}
return sent_bytes;
}