+/* {{{ 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);
+ }
+ return FAILURE;
+ }
+ if (free_header && header) {
+ efree(header);
+ }
+ zend_bailout();
+ /* fake */
+ return SUCCESS;
+}
+/* }}} */
+
+/* {{{ STATUS http_check_method(char *) */
+STATUS _http_check_method_ex(const char *method, const char *methods)
+{
+ const char *found;
+
+ if ( (found = strstr(methods, method)) &&
+ (found == method || !isalpha(found[-1])) &&
+ (!isalpha(found[strlen(method) + 1]))) {
+ return SUCCESS;
+ }
+ return FAILURE;
+}
+/* }}} */
+