}
/* }}} */
+/* {{{ http_boundary(char *, size_t) */
+size_t _http_boundary(char *buf, size_t buf_len TSRMLS_DC)
+{
+ return snprintf(buf, buf_len, "%lu%0.9f", (ulong) HTTP_G->request.time, (float) php_combined_lcg(TSRMLS_C));
+}
+/* }}} */
+
/* {{{ void http_error(long, long, char*) */
void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...)
{
zend_llist_add_element(&pool->handles, &request);
++pool->unfinished;
-#ifdef HTTP_HAVE_EVENT
- if (pool->runsocket) {
- while (CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(pool->ch, &pool->unfinished));
- }
-#endif
#if HTTP_DEBUG_REQPOOLS
fprintf(stderr, "> %d HttpRequests attached to pool %p\n", zend_llist_count(&pool->handles), pool);
#endif
#if HTTP_DEBUG_REQPOOLS
fprintf(stderr, "> %d HttpRequests remaining in pool %p\n", zend_llist_count(&pool->handles), pool);
#endif
-
+
return SUCCESS;
}
return FAILURE;
#ifdef HTTP_HAVE_EVENT
if (pool->useevents) {
- /* run socket action */
- pool->runsocket = 1;
do {
while (CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(pool->ch, &pool->unfinished));
event_base_dispatch(HTTP_G->request.pool.event.base);
if (CURLM_OK != rc) {
http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc));
}
-
+#if 0
http_request_pool_timer_callback(pool->ch, 1000, pool);
+#endif
}
}
/* }}} */
#endif
} while (CURLM_CALL_MULTI_PERFORM == rc);
- if (CURLM_OK != rc) {
- http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc));
+ switch (rc) {
+ case CURLM_BAD_SOCKET:
+#if 0
+ fprintf(stderr, "!!! Bad socket: %d (%d)\n", socket, (int) action);
+#endif
+ case CURLM_OK:
+ break;
+ default:
+ http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc));
+ break;
}
http_request_pool_responsehandler(pool);
char boundary_str[32], range_header_str[256];
size_t boundary_len, range_header_len;
- boundary_len = snprintf(boundary_str, sizeof(boundary_str), "%lu%0.9f", (ulong) HTTP_G->request.time, (float) php_combined_lcg(TSRMLS_C));
+ boundary_len = http_boundary(boundary_str, sizeof(boundary_str));
range_header_len = snprintf(range_header_str, sizeof(range_header_str), "Content-Type: multipart/byteranges; boundary=%s", boundary_str);
http_send_status_header_ex(206, range_header_str, range_header_len, 1);
<email>mike@php.net</email>
<active>yes</active>
</lead>
- <date>2007-05-01</date>
+ <date>2007-06-12</date>
<version>
- <release>1.6.0dev</release>
+ <release>1.6.0b1</release>
<api>1.6.0</api>
</version>
<stability>
</stability>
<license>BSD, revised</license>
<notes><![CDATA[
-* Fixed libcurl SLL library detection for libcurl >= 7.16.2
+ Added 'retrycount' and 'retrydelay' request options
+ Added libevent support for libcurl (>= 7.16.0):
o added --with-http-curl-libevent configure option
#ifndef PHP_EXT_HTTP_H
#define PHP_EXT_HTTP_H
-#define PHP_EXT_HTTP_VERSION "1.6.0dev"
+#define PHP_EXT_HTTP_VERSION "1.6.0b1"
#ifdef HAVE_CONFIG_H
# include "config.h"
#define pretty_key(key, key_len, uctitle, xhyphen) _http_pretty_key(key, key_len, uctitle, xhyphen)
extern char *_http_pretty_key(char *key, size_t key_len, zend_bool uctitle, zend_bool xhyphen);
+#define http_boundary(b, l) _http_boundary((b), (l) TSRMLS_CC)
+extern size_t _http_boundary(char *buf, size_t len TSRMLS_DC);
+
#define http_error(type, code, string) _http_error_ex(type, code, "%s", string)
#define http_error_ex _http_error_ex
extern void _http_error_ex(long type TSRMLS_DC, long code, const char *format, ...);