+/* {{{ void http_error(long, long, char*) */
+void _http_error_ex(long type, long code, const char *format, ...)
+{
+ va_list args;
+ TSRMLS_FETCH();
+
+ va_start(args, format);
+ if (type == E_THROW) {
+#ifdef ZEND_ENGINE_2
+ char *message;
+ vspprintf(&message, 0, format, args);
+ zend_throw_exception(http_exception_get_for_code(code), message, code TSRMLS_CC);
+#else
+ type = E_WARNING;
+#endif
+ }
+ if (type != E_THROW) {
+ php_verror(NULL, "", type, format, args TSRMLS_CC);
+ }
+ va_end(args);
+}
+/* }}} */
+
+/* {{{ STATUS http_exit(int, char*) */
+STATUS _http_exit_ex(int status, char *header, zend_bool free_header TSRMLS_DC)
+{
+ if (SUCCESS != http_send_status_header(status, header)) {
+ http_error_ex(E_WARNING, HTTP_E_HEADER, "Failed to exit with status/header: %d - %s", status, header ? header : "");
+ if (free_header && header) {
+ efree(header);