ums = php_parse_date(header, NULL);
efree(header);
- if (ums > 0 && ums <= lm) {
+ if (ums > 0 && ums >= lm) {
return PHP_HTTP_CACHE_HIT;
} else {
return PHP_HTTP_CACHE_MISS;
php_http_buffer_dtor(&buf);
zval_ptr_dtor(&zoption_copy);
+ zval_ptr_dtor(&zoption);
}
if (ret != SUCCESS) {
static STATUS php_http_env_response_send_body(php_http_env_response_t *r)
{
STATUS ret = SUCCESS;
- zval *zbody;
+ zval *zbody, *zoption;
TSRMLS_FETCH_FROM_CTX(r->ts);
if (r->done) {
) {
php_http_message_body_object_t *obj = zend_object_store_get_object(zbody TSRMLS_CC);
+ if ((zoption = get_option(r->options, ZEND_STRL("throttleDelay") TSRMLS_CC))) {
+ if (Z_TYPE_P(zoption) == IS_DOUBLE) {
+ r->throttle.delay = Z_DVAL_P(zoption);
+ }
+ zval_ptr_dtor(&zoption);
+ }
+ if ((zoption = get_option(r->options, ZEND_STRL("throttleChunk") TSRMLS_CC))) {
+ if (Z_TYPE_P(zoption) == IS_LONG) {
+ r->throttle.chunk = Z_LVAL_P(zoption);
+ }
+ zval_ptr_dtor(&zoption);
+ }
+
if (r->range.status == PHP_HTTP_RANGE_OK) {
if (zend_hash_num_elements(&r->range.values) == 1) {
/* single range */
double delay = 1;
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|d", &chunk_size, &delay)) {
- long chunk_size_long = (long) chunk_size;
-
set_option(getThis(), ZEND_STRL("throttleDelay"), IS_DOUBLE, &delay, 0 TSRMLS_CC);
- set_option(getThis(), ZEND_STRL("throttleChunk"), IS_LONG, &chunk_size_long, 0 TSRMLS_CC);
+ set_option(getThis(), ZEND_STRL("throttleChunk"), IS_LONG, &chunk_size, 0 TSRMLS_CC);
RETURN_TRUE;
}
RETURN_FALSE;