save funccall
[m6w6/ext-http] / php_http_client_curl.c
index c6918426264ea3fa32df358a5f208c2ba14d63b5..501c2521e7aff2acd3773d71740c7731195c8cb6 100644 (file)
@@ -258,6 +258,8 @@ static int php_http_curle_raw_callback(CURL *ch, curl_infotype type, char *data,
                                h->progress.info = "blacklist check";
                        } else if (php_memnstr(data, ZEND_STRL("SSL"), data + length)) {
                                h->progress.info = "ssl negotiation";
+                       } else if (php_memnstr(data, ZEND_STRL("upload"), data + length)) {
+                               h->progress.info = "uploaded";
                        } else if (php_memnstr(data, ZEND_STRL("left intact"), data + length)) {
                                h->progress.info = "not disconnected";
                        } else if (php_memnstr(data, ZEND_STRL("closed"), data + length)) {
@@ -269,6 +271,7 @@ static int php_http_curle_raw_callback(CURL *ch, curl_infotype type, char *data,
                        } else {
 #if PHP_DEBUG
                                h->progress.info = data;
+                               data[length - 1] = '\0';
 #endif
                        }
                        if (h->client->callback.progress.func) {
@@ -1100,7 +1103,11 @@ static void php_http_curle_options_init(php_http_options_t *registry TSRMLS_DC)
        /* useragent */
        if ((opt = php_http_option_register(registry, ZEND_STRL("useragent"), CURLOPT_USERAGENT, IS_STRING))) {
                /* don't check strlen, to allow sending no useragent at all */
-               ZVAL_STRING(&opt->defval, "PECL::HTTP/" PHP_PECL_HTTP_VERSION " (PHP/" PHP_VERSION ")", 0);
+               ZVAL_STRING(&opt->defval,
+                               "PECL_HTTP/" PHP_PECL_HTTP_VERSION " "
+                               "PHP/" PHP_VERSION " "
+                               "libcurl/" LIBCURL_VERSION
+                       , 0);
        }
 
        /* resume */