From 172f59205374c1bb5e9cbb4124d79b39502668a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= <gambas@users.sourceforge.net>
Date: Sun, 19 May 2013 19:04:37 +0000
Subject: [PATCH] [GB.NET.CURL] * NEW: HttpClient now raises the Progress
 event.

git-svn-id: svn://localhost/gambas/trunk@5664 867c0c6c-44f3-4631-809d-bfa615b0a4ec
---
 gb.net.curl/src/CFtpClient.c  | 1 -
 gb.net.curl/src/CHttpClient.c | 6 ++++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/gb.net.curl/src/CFtpClient.c b/gb.net.curl/src/CFtpClient.c
index 5aeba7726..17bae5a4f 100644
--- a/gb.net.curl/src/CFtpClient.c
+++ b/gb.net.curl/src/CFtpClient.c
@@ -84,7 +84,6 @@ static void ftp_reset(void *_object)
 {
 	GB.FreeString(&THIS->data);
 	GB.Unref(&THIS_FTP->commands);
-	CURL_set_progress(THIS_CURL, FALSE);
 }
 
 
diff --git a/gb.net.curl/src/CHttpClient.c b/gb.net.curl/src/CHttpClient.c
index 4756e83bf..1035c9aea 100644
--- a/gb.net.curl/src/CHttpClient.c
+++ b/gb.net.curl/src/CHttpClient.c
@@ -301,6 +301,7 @@ static void http_get(void *_object, GB_ARRAY custom_headers, char *target)
 	}
 	
 	curl_easy_setopt(THIS_CURL, CURLOPT_HTTPHEADER, headers);
+	CURL_set_progress(THIS_CURL, TRUE);
 
 	if (THIS->async)
 	{
@@ -359,7 +360,6 @@ static void http_send(void *_object, int type, char *sContent, char *sData, int
 	
 	THIS_HTTP->len_sent = 0;
 
-
 	mylen = strlen(sContent) + strlen("Content-Type: ") + 1;
 	GB.Alloc((void*)&THIS_HTTP->sContentType, mylen);
 	
@@ -392,6 +392,8 @@ static void http_send(void *_object, int type, char *sContent, char *sData, int
 		curl_easy_setopt(THIS_CURL, CURLOPT_POSTFIELDSIZE, lendata);
 	}
 
+	CURL_set_progress(THIS_CURL, TRUE);
+	
 	if (THIS->async)
 	{
 		CURL_start_post(THIS);
@@ -448,7 +450,7 @@ BEGIN_PROPERTY(HttpClient_CookiesFile)
 END_PROPERTY
 
 
-BEGIN_PROPERTY (HttpClient_Auth)
+BEGIN_PROPERTY(HttpClient_Auth)
 
 	if (READ_PROPERTY)
 	{