| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-2010, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
return NULL;
} else {
size_t ssb_len;
- char ssb_buf[128] = {0};
+ char ssb_buf[128];
- ssb_len = snprintf(ssb_buf, 127, "%ld=%ld=%ld", (long) ssb.sb.st_mtime,
+ ssb_len = snprintf(ssb_buf, sizeof(ssb_buf), "%ld=%ld=%ld", (long) ssb.sb.st_mtime,
(long) ssb.sb.st_ino,
(long) ssb.sb.st_size);
http_etag_update(ctx, ssb_buf, ssb_len);
zval *zmodified;
char *modified, *chr_ptr;
- HTTP_GSC(zmodified, entry, !enforce_presence);
+ if (!(zmodified = http_get_server_var(entry, 1))) {
+ return !enforce_presence;
+ }
modified = estrndup(Z_STRVAL_P(zmodified), Z_STRLEN_P(zmodified));
if ((chr_ptr = strrchr(modified, ';'))) {
char *quoted_etag;
zend_bool result;
- HTTP_GSC(zetag, entry, !enforce_presence);
+ if (!(zetag = http_get_server_var_ex(entry, strlen(entry)+1, 1))) {
+ return !enforce_presence;
+ }
if (NULL != strchr(Z_STRVAL_P(zetag), '*')) {
return 1;
PHP_HTTP_API STATUS _http_start_ob_etaghandler(TSRMLS_D)
{
/* already running? */
+#ifdef PHP_OUTPUT_NEWAPI
+ STATUS rv;
+
+ if (php_output_handler_conflict(ZEND_STRL("ob_etaghandler"), ZEND_STRL("ob_etaghandler") TSRMLS_CC)) {
+ return FAILURE;
+ }
+#else
if (php_ob_handler_used("ob_etaghandler" TSRMLS_CC)) {
http_error(HE_WARNING, HTTP_E_RUNTIME, "ob_etaghandler can only be used once");
return FAILURE;
}
-
+#endif
HTTP_G->etag.started = 1;
+#ifdef PHP_OUTPUT_NEWAPI
+ return php_output_start_internal(ZEND_STRL("ob_etaghandler"), _http_ob_etaghandler, HTTP_G->send.buffer_size, 0 TSRMLS_CC);
+#else
return php_start_ob_buffer_named("ob_etaghandler", HTTP_G->send.buffer_size, 0 TSRMLS_CC);
+#endif
}
PHP_HTTP_API zend_bool _http_interrupt_ob_etaghandler(TSRMLS_D)