cvs: pecl(R_1_5) /http http_request_api.c http_request_body_api.c
| From: | Michael Wallner | Date: | Wed, 29 Aug 2007 19:36:34 +0000 |
| Subject: | cvs: pecl(R_1_5) /http http_request_api.c http_request_body_api.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-8485@lists.php.net to get a copy of this message | ||
mike Wed Aug 29 19:36:34 2007 UTC
Modified files: (Branch: R_1_5)
/pecl/http http_request_api.c http_request_body_api.c
Log:
MFH: remove LFS dependent parts
http://cvs.php.net/viewvc.cgi/pecl/http/http_request_api.c?r1=1.155&r2=1.155.2.1&diff_format=u
Index: pecl/http/http_request_api.c
diff -u pecl/http/http_request_api.c:1.155 pecl/http/http_request_api.c:1.155.2.1
--- pecl/http/http_request_api.c:1.155 Fri Feb 23 08:03:24 2007
+++ pecl/http/http_request_api.c Wed Aug 29 19:36:33 2007
@@ -10,7 +10,7 @@
+--------------------------------------------------------------------+
*/
-/* $Id: http_request_api.c,v 1.155 2007/02/23 08:03:24 mike Exp $ */
+/* $Id: http_request_api.c,v 1.155.2.1 2007/08/29 19:36:33 mike Exp $ */
#define HTTP_WANT_SAPI
#define HTTP_WANT_CURL
@@ -376,10 +376,6 @@
HTTP_CURL_OPT(CURLOPT_IPRESOLVE, 0);
HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, 0L);
HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, 0L);
-#if HTTP_CURL_VERSION(7,15,5)
- HTTP_CURL_OPT(CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t) 0);
- HTTP_CURL_OPT(CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t) 0);
-#endif
/* crashes
HTTP_CURL_OPT(CURLOPT_MAXCONNECTS, 5L); */
HTTP_CURL_OPT(CURLOPT_FRESH_CONNECT, 0L);
@@ -515,14 +511,6 @@
if ((zoption = http_request_option(request, options, "low_speed_time", IS_LONG))) {
HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, Z_LVAL_P(zoption));
}
-#if HTTP_CURL_VERSION(7,15,5)
- if ((zoption = http_request_option(request, options, "max_send_speed", IS_LONG))) {
- HTTP_CURL_OPT(CURLOPT_MAX_SEND_SPEED_LARGE, (curl_off_t) Z_LVAL_P(zoption));
- }
- if ((zoption = http_request_option(request, options, "max_recv_speed", IS_LONG))) {
- HTTP_CURL_OPT(CURLOPT_MAX_RECV_SPEED_LARGE, (curl_off_t) Z_LVAL_P(zoption));
- }
-#endif
/* crashes
if ((zoption = http_request_option(request, options, "maxconnects", IS_LONG))) {
HTTP_CURL_OPT(CURLOPT_MAXCONNECTS, Z_LVAL_P(zoption));
http://cvs.php.net/viewvc.cgi/pecl/http/http_request_body_api.c?r1=1.17&r2=1.17.2.1&diff_format=u
Index: pecl/http/http_request_body_api.c
diff -u pecl/http/http_request_body_api.c:1.17 pecl/http/http_request_body_api.c:1.17.2.1
--- pecl/http/http_request_body_api.c:1.17 Wed Feb 7 11:50:27 2007
+++ pecl/http/http_request_body_api.c Wed Aug 29 19:36:33 2007
@@ -10,7 +10,7 @@
+--------------------------------------------------------------------+
*/
-/* $Id: http_request_body_api.c,v 1.17 2007/02/07 11:50:27 mike Exp $ */
+/* $Id: http_request_body_api.c,v 1.17.2.1 2007/08/29 19:36:33 mike Exp $ */
#define HTTP_WANT_CURL
#include "php_http.h"
@@ -21,63 +21,6 @@
#include "php_http_url_api.h"
#include "php_http_request_body_api.h"
-#if defined(HAVE_CURL_GETFORMDATA) && !defined(HAVE_CURL_FORMGET)
-struct FormData {
- struct FormData *next;
- int type;
- char *line;
- size_t length;
-};
-
-CURLcode Curl_getFormData(struct FormData **, struct curl_httppost *post, curl_off_t *size);
-
-static char *file_get_contents(char *file, size_t *len TSRMLS_DC)
-{
- php_stream *s = NULL;
- char *buf = NULL;
-
- if ((s = php_stream_open_wrapper_ex(file, "rb", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL,
HTTP_DEFAULT_STREAM_CONTEXT))) {
- *len = php_stream_copy_to_mem(s, &buf, (size_t) -1, 0);
- php_stream_close(s);
- } else {
- *len = 0;
- }
- return buf;
-}
-
-static int curl_formget(struct FormData *post, phpstr *str TSRMLS_DC)
-{
- int fgc_error = 0;
- char *fdata;
- size_t fsize;
- struct FormData *next, *pptr = post;
-
- while (pptr) {
- next = pptr->next;
-
- if (!fgc_error) {
- if (pptr->type) {
- if ((fdata = file_get_contents(pptr->line, &fsize TSRMLS_CC))) {
- phpstr_append(str, fdata, fsize);
- efree(fdata);
- } else {
- fgc_error = 1;
- }
- } else {
- phpstr_append(str, pptr->line, pptr->length);
- }
- }
-
- curl_free(pptr->line);
- curl_free(pptr);
- pptr = next;
- }
-
- return fgc_error;
-}
-#endif
-
-
/* {{{ http_request_body *http_request_body_new() */
PHP_HTTP_API http_request_body *_http_request_body_init_ex(http_request_body *body, int type, void
*data, size_t size, zend_bool free ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC TSRMLS_DC)
{
@@ -214,23 +157,6 @@
*len = PHPSTR_LEN(&str);
return SUCCESS;
}
-#elif defined(HAVE_CURL_GETFORMDATA)
- struct FormData *data;
- curl_off_t size;
-
- if (!Curl_getFormData(&data, body->data, &size)) {
- phpstr str;
-
- phpstr_init_ex(&str, (size_t) size, 0);
- if (curl_formget(data, &str TSRMLS_CC)) {
- phpstr_dtor(&str);
- } else {
- phpstr_fix(&str);
- *buf = PHPSTR_VAL(&str);
- *len = PHPSTR_LEN(&len);
- return SUCCESS;
- }
- }
#endif
break;
}