felipe          Sat Jul 12 21:20:11 2008 UTC

  Modified files:              
    /php-src/ext/curl   interface.c 
  Log:
  - MFB: Fixed bug #45220 (curl_read callback returns -1 when needs to return 
size_t (unsigned))
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/curl/interface.c?r1=1.123&r2=1.124&diff_format=u
Index: php-src/ext/curl/interface.c
diff -u php-src/ext/curl/interface.c:1.123 php-src/ext/curl/interface.c:1.124
--- php-src/ext/curl/interface.c:1.123  Tue Jul  1 08:10:47 2008
+++ php-src/ext/curl/interface.c        Sat Jul 12 21:20:10 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: interface.c,v 1.123 2008/07/01 08:10:47 tony2001 Exp $ */
+/* $Id: interface.c,v 1.124 2008/07/12 21:20:10 felipe Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -785,7 +785,7 @@
 {
        php_curl       *ch = (php_curl *) ctx;
        php_curl_read  *t  = ch->handlers->read;
-       int             length = -1;
+       int             length = 0;
 
        switch (t->method) {
                case PHP_CURL_DIRECT:
@@ -832,7 +832,9 @@
                        ch->in_callback = 0;
                        if (error == FAILURE) {
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, 
"Cannot call the CURLOPT_READFUNCTION"); 
-                               length = -1;
+#if LIBCURL_VERSION_NUM >= 0x070c01 /* 7.12.1 */
+                               length = CURL_READFUNC_ABORT;
+#endif
                        } else if (retval_ptr) {
                                if (Z_TYPE_P(retval_ptr) == IS_STRING) {
                                        length = MIN(size * nmemb, 
Z_STRLEN_P(retval_ptr));



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to