+ if (JSON_G(error_code)) {
+ if (JSON_POST_G(error_response)) {
+ char header[] = "X-JSON-Error-Code: ";
+ zend_print_long_to_buf(header + sizeof(header) - 1, (JSON_G(error_code) & 0xff));
+ sapi_header_op(SAPI_HEADER_SET_STATUS, (void *) (long) JSON_POST_G(error_response) TSRMLS_CC);
+ sapi_add_header(header, sizeof(header)-1, 1);
+ }
+ if (JSON_POST_G(error_exit)) {
+ sapi_send_headers(TSRMLS_C);
+ zend_bailout();
+ }
+ }
+}
+