- remove LFS dependant parts which caused some real weirdance with curl_share
authorMichael Wallner <mike@php.net>
Fri, 8 Jun 2007 08:25:10 +0000 (08:25 +0000)
committerMichael Wallner <mike@php.net>
Fri, 8 Jun 2007 08:25:10 +0000 (08:25 +0000)
KnownIssues.txt
config9.m4
http_request_api.c
http_request_body_api.c

index c6565b23402306b054364d18706e1a2263ab973e..ca7e2ccfb1296317874ee351606a5bb7a1a7f8ca 100644 (file)
@@ -16,3 +16,5 @@ Internals:
        Inflating raw deflated data causes a re-initialization of the inflate
                stream where the corresponding window bits are modified to tell libz
                to not check for zlib header bytes.  This is not preventable AFAICS.
+       LFS dependant parts of libcurl are left out because of off_t,
+               respectively off64_t confusion.
index e54f29a1790ad616dd7a0962b1f97f227ba434e5..eff224924557932163d1c41d02a1519e35ac6f5c 100644 (file)
@@ -38,6 +38,8 @@ if test "$PHP_HTTP" != "no"; then
                ])
        ])
        
+       AC_PROG_CPP
+       
        if test "$PHP_HTTP_SHARED_DEPS" != "no"; then
                AC_DEFINE([HTTP_SHARED_DEPS], [1], [ ])
        else
@@ -178,18 +180,21 @@ dnl ----
                        AC_MSG_ERROR([libcurl version greater or equal to 7.12.3 required])
                fi
                
-               AC_PROG_CPP
+               dnl
+               dnl compile tests
+               dnl
+               
+               save_CFLAGS="$CFLAGS"
+               CFLAGS="`$CURL_CONFIG --cflags`"
+               save_LDFLAGS="$LDFLAGS"
+               LDFLAGS="`$CURL_CONFIG --libs` $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR"
+               
                AC_MSG_CHECKING([for SSL support in libcurl])
                CURL_SSL=`$CURL_CONFIG --feature | $EGREP SSL`
                if test "$CURL_SSL" = "SSL"; then
                        AC_MSG_RESULT([yes])
                        AC_DEFINE([HTTP_HAVE_SSL], [1], [ ])
                        
-                       save_CFLAGS="$CFLAGS"
-                       CFLAGS="`$CURL_CONFIG --cflags`"
-                       save_LDFLAGS="$LDFLAGS"
-                       LDFLAGS="`$CURL_CONFIG --libs` $ld_runpath_switch$CURL_DIR/$PHP_LIBDIR"
-                       
                        AC_MSG_CHECKING([for openssl support in libcurl])
                        AC_TRY_RUN([
                                #include <curl/curl.h>
@@ -235,13 +240,15 @@ dnl ----
                        ], [
                                AC_MSG_RESULT([no])
                        ])
-                       
-                       CFLAGS="$save_CFLAGS"
-                       LDFLAGS="$save_LDFLAGS"
                else
                        AC_MSG_RESULT([no])
                fi
                
+               CFLAGS="$save_CFLAGS"
+               LDFLAGS="$save_LDFLAGS"
+               
+               dnl end compile tests
+               
                AC_MSG_CHECKING([for bundled SSL CA info])
                CURL_CAINFO=
                for i in `$CURL_CONFIG --ca` "/etc/ssl/certs/ca-certificates.crt"; do
@@ -278,12 +285,6 @@ dnl ----
                        [AC_DEFINE([HAVE_CURL_EASY_RESET], [1], [ ])], [ ],
                        [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
                )
-               dnl Debian suddenly (>=7.14.1-2) hides all symbols not starting with "curl"
-               PHP_CHECK_LIBRARY(curl, Curl_getFormData,
-                       [AC_DEFINE([HAVE_CURL_GETFORMDATA], [1], [ ])], [ ],
-                       [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
-               )
-               dnl New API function which obsoletes use of Curl_getFormData (>=7.15.5)
                PHP_CHECK_LIBRARY(curl, curl_formget,
                        [AC_DEFINE([HAVE_CURL_FORMGET], [1], [ ])], [ ],
                        [$CURL_LIBS -L$CURL_DIR/$PHP_LIBDIR]
index 6c7df822c189b0917a0671e89fde4c16256c7e3a..e815169408f5570a652aa1435db52b32561f4170 100644 (file)
@@ -377,8 +377,10 @@ PHP_HTTP_API void _http_request_defaults(http_request *request)
                HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, 0L);
                HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, 0L);
 #if HTTP_CURL_VERSION(7,15,5)
+               /* LFS weirdance
                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); */
@@ -516,12 +518,14 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti
                HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, Z_LVAL_P(zoption));
        }
 #if HTTP_CURL_VERSION(7,15,5)
+       /* LSF weirdance
        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))) {
index 88732a1dada1589551f55eca5913dd6200791478..39cba652c70cf7e14390fbaa564b1236f36e45c7 100644 (file)
 #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 @@ PHP_HTTP_API STATUS _http_request_body_encode(http_request_body *body, char **bu
                                *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;
                }