cvs: pecl /http http_api.c http_request_pool_api.c http_send_api.c package2.xml php_http.h php_http_api.h
| From: | Michael Wallner | Date: | Wed, 05 Sep 2007 12:15:25 +0000 |
| Subject: | cvs: pecl /http http_api.c http_request_pool_api.c http_send_api.c package2.xml php_http.h php_http_api.h | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-8510@lists.php.net to get a copy of this message | ||
mike Wed Sep 5 12:15:25 2007 UTC
Modified files:
/pecl/http http_api.c http_request_pool_api.c http_send_api.c
package2.xml php_http.h php_http_api.h
Log:
- separate http_boundary()
- odd fixes for libevent support
http://cvs.php.net/viewvc.cgi/pecl/http/http_api.c?r1=1.166&r2=1.167&diff_format=u
Index: pecl/http/http_api.c
diff -u pecl/http/http_api.c:1.166 pecl/http/http_api.c:1.167
--- pecl/http/http_api.c:1.166 Wed May 16 19:26:26 2007
+++ pecl/http/http_api.c Wed Sep 5 12:15:25 2007
@@ -10,7 +10,7 @@
+--------------------------------------------------------------------+
*/
-/* $Id: http_api.c,v 1.166 2007/05/16 19:26:26 mike Exp $ */
+/* $Id: http_api.c,v 1.167 2007/09/05 12:15:25 mike Exp $ */
#define HTTP_WANT_SAPI
#include "php_http.h"
@@ -94,6 +94,13 @@
}
/* }}} */
+/* {{{ 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, ...)
{
http://cvs.php.net/viewvc.cgi/pecl/http/http_request_pool_api.c?r1=1.58&r2=1.59&diff_format=u
Index: pecl/http/http_request_pool_api.c
diff -u pecl/http/http_request_pool_api.c:1.58 pecl/http/http_request_pool_api.c:1.59
--- pecl/http/http_request_pool_api.c:1.58 Wed Jun 6 10:32:39 2007
+++ pecl/http/http_request_pool_api.c Wed Sep 5 12:15:25 2007
@@ -10,7 +10,7 @@
+--------------------------------------------------------------------+
*/
-/* $Id: http_request_pool_api.c,v 1.58 2007/06/06 10:32:39 mike Exp $ */
+/* $Id: http_request_pool_api.c,v 1.59 2007/09/05 12:15:25 mike Exp $ */
#define HTTP_WANT_CURL
#define HTTP_WANT_EVENT
@@ -132,11 +132,6 @@
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
@@ -177,7 +172,7 @@
#if HTTP_DEBUG_REQPOOLS
fprintf(stderr, "> %d HttpRequests remaining in pool %p\n",
zend_llist_count(&pool->handles), pool);
#endif
-
+
return SUCCESS;
}
return FAILURE;
@@ -265,8 +260,6 @@
#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);
@@ -473,8 +466,9 @@
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
}
}
/* }}} */
@@ -518,8 +512,16 @@
#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);
http://cvs.php.net/viewvc.cgi/pecl/http/http_send_api.c?r1=1.70&r2=1.71&diff_format=u
Index: pecl/http/http_send_api.c
diff -u pecl/http/http_send_api.c:1.70 pecl/http/http_send_api.c:1.71
--- pecl/http/http_send_api.c:1.70 Wed Feb 7 11:50:27 2007
+++ pecl/http/http_send_api.c Wed Sep 5 12:15:25 2007
@@ -10,7 +10,7 @@
+--------------------------------------------------------------------+
*/
-/* $Id: http_send_api.c,v 1.70 2007/02/07 11:50:27 mike Exp $ */
+/* $Id: http_send_api.c,v 1.71 2007/09/05 12:15:25 mike Exp $ */
#define HTTP_WANT_SAPI
#define HTTP_WANT_ZLIB
@@ -420,7 +420,7 @@
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);
http://cvs.php.net/viewvc.cgi/pecl/http/package2.xml?r1=1.163&r2=1.164&diff_format=u
Index: pecl/http/package2.xml
diff -u pecl/http/package2.xml:1.163 pecl/http/package2.xml:1.164
--- pecl/http/package2.xml:1.163 Sat May 19 19:31:37 2007
+++ pecl/http/package2.xml Wed Sep 5 12:15:25 2007
@@ -28,9 +28,9 @@
<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>
@@ -39,7 +39,6 @@
</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
http://cvs.php.net/viewvc.cgi/pecl/http/php_http.h?r1=1.191&r2=1.192&diff_format=u
Index: pecl/http/php_http.h
diff -u pecl/http/php_http.h:1.191 pecl/http/php_http.h:1.192
--- pecl/http/php_http.h:1.191 Fri Apr 27 06:46:16 2007
+++ pecl/http/php_http.h Wed Sep 5 12:15:25 2007
@@ -10,12 +10,12 @@
+--------------------------------------------------------------------+
*/
-/* $Id: php_http.h,v 1.191 2007/04/27 06:46:16 mike Exp $ */
+/* $Id: php_http.h,v 1.192 2007/09/05 12:15:25 mike Exp $ */
#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"
http://cvs.php.net/viewvc.cgi/pecl/http/php_http_api.h?r1=1.85&r2=1.86&diff_format=u
Index: pecl/http/php_http_api.h
diff -u pecl/http/php_http_api.h:1.85 pecl/http/php_http_api.h:1.86
--- pecl/http/php_http_api.h:1.85 Wed May 16 19:26:26 2007
+++ pecl/http/php_http_api.h Wed Sep 5 12:15:25 2007
@@ -10,7 +10,7 @@
+--------------------------------------------------------------------+
*/
-/* $Id: php_http_api.h,v 1.85 2007/05/16 19:26:26 mike Exp $ */
+/* $Id: php_http_api.h,v 1.86 2007/09/05 12:15:25 mike Exp $ */
#ifndef PHP_HTTP_API_H
#define PHP_HTTP_API_H
@@ -36,6 +36,9 @@
#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, ...);