/* {{{ proto bool http_cache_last_modified([int timestamp_or_expires]])
*
- * If timestamp_or_exires is greater than 0, it is handled as timestamp
+ * If timestamp_or_expires is greater than 0, it is handled as timestamp
* and will be sent as date of last modification. If it is 0 or omitted,
* the current time will be sent as Last-Modified date. If it's negative,
* it is handled as expiration time in seconds, which means that if the
}
convert_to_string_ex(&zdata);
- http_send_header("Accept-Ranges: bytes");
RETURN_SUCCESS(http_send_data(Z_STRVAL_P(zdata), Z_STRLEN_P(zdata)));
}
/* }}} */
RETURN_FALSE;
}
- http_send_header("Accept-Ranges: bytes");
RETURN_SUCCESS(http_send_file(file));
}
/* }}} */
}
php_stream_from_zval(file, &zstream);
- http_send_header("Accept-Ranges: bytes");
RETURN_SUCCESS(http_send_stream(file));
}
/* }}} */
RETURN_FALSE;
}
- if (SUCCESS == http_chunked_decode(encoded, encoded_len, &decoded, &decoded_len)) {
+ if (NULL != http_chunked_decode(encoded, encoded_len, &decoded, &decoded_len)) {
RETURN_STRINGL(decoded, decoded_len, 0);
} else {
RETURN_FALSE;
* <?php
* array(
* 0 => array(
- * 'Status' => '200 Ok',
+ * 'Response Status' => '200 Ok',
* 'Content-Type' => 'text/plain',
* 'Content-Language' => 'en-US'
* ),
*/
PHP_FUNCTION(http_parse_headers)
{
- char *header, *rnrn;
+ char *header;
int header_len;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &header, &header_len)) {
}
array_init(return_value);
-
- if (rnrn = strstr(header, HTTP_CRLF HTTP_CRLF)) {
- header_len = rnrn - header + 2;
- }
- if (SUCCESS != http_parse_headers(header, header_len, return_value)) {
+ if (SUCCESS != http_parse_headers(header, return_value)) {
http_error(E_WARNING, HTTP_E_PARSE, "Could not parse HTTP headers");
zval_dtor(return_value);
RETURN_FALSE;
* - lastmodified: int, timestamp for If-(Un)Modified-Since header
* - timeout: int, seconds the request may take
* - connecttimeout: int, seconds the connect may take
+ * - onprogress: mixed, progress callback
+ * - ondebug: mixed, debug callback
* </pre>
*
* The optional third parameter will be filled with some additional information
PHP_FUNCTION(http_test)
{
+ RETURN_NULL();
}
/*