[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/curl_adapter.cpp
From: |
Benjamin Wolsey |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/curl_adapter.cpp |
Date: |
Mon, 01 Oct 2007 14:20:20 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Benjamin Wolsey <bwy> 07/10/01 14:20:20
Modified files:
. : ChangeLog
libbase : curl_adapter.cpp
Log message:
* libbase/curl_adapter.cpp: use curl_multi_info_read to get
better information about stream connections. Pass on CURL
errors
if transaction fails (e.g. for self-certified SSL sites like
Savannah. Log HTTP code of all transactions. 400 and above logged as
error.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4491&r2=1.4492
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/curl_adapter.cpp?cvsroot=gnash&r1=1.40&r2=1.41
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4491
retrieving revision 1.4492
diff -u -b -r1.4491 -r1.4492
--- ChangeLog 1 Oct 2007 12:39:22 -0000 1.4491
+++ ChangeLog 1 Oct 2007 14:20:18 -0000 1.4492
@@ -1,3 +1,10 @@
+2007-10-01 Benjamin Wolsey <address@hidden>
+
+ * libbase/curl_adapter.cpp: use curl_multi_info_read to get
+ better information about stream connections. Pass on CURL errors
+ if transaction fails (e.g. for self-certified SSL sites like
Savannah).
+ Log HTTP code of all transactions. 400 and above logged as error.
+
2007-09-30 Sandro Santilli <address@hidden>
* libbase/Makefile.am, libmedia/Makefile.am: remove no-dependencies
Index: libbase/curl_adapter.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/curl_adapter.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -b -r1.40 -r1.41
--- libbase/curl_adapter.cpp 30 Sep 2007 18:51:27 -0000 1.40
+++ libbase/curl_adapter.cpp 1 Oct 2007 14:20:19 -0000 1.41
@@ -17,7 +17,7 @@
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
-/* $Id: curl_adapter.cpp,v 1.40 2007/09/30 18:51:27 bwy Exp $ */
+/* $Id: curl_adapter.cpp,v 1.41 2007/10/01 14:20:19 bwy Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -392,14 +392,48 @@
}
- // TODO: check for 404 only once !
+ CURLMsg *curl_msg;
+ int _active = _running; // Is _running a suitable var for the number
+ // of active easy_handles? (Which seems
+ // to be a maximum of 1 anyway).
+
+ while ((curl_msg = curl_multi_info_read(_mhandle, &_active))) {
+
+ // Only for completed transactions
+ if (curl_msg->msg == CURLMSG_DONE) {
+
+ // HTTP transaction succeeded
+ if (curl_msg->data.result == CURLE_OK) {
+
long code;
- curl_easy_getinfo(_handle, CURLINFO_RESPONSE_CODE, &code);
- if ( code == 404 ) // file not found!
- {
- gnash::log_error(_("404 response from url %s"), _url.c_str());
+
+ // Check HTTP response
+ curl_easy_getinfo(curl_msg->easy_handle,
+ CURLINFO_RESPONSE_CODE,
&code);
+
+ if ( code >= 400 ) {
+ gnash::log_error ("HTTP response %d
from url %s",
+ code, _url.c_str());
_error = TU_FILE_OPEN_ERROR;
_running = false;
+ } else {
+ gnash::log_msg ("HTTP response %d from
url %s",
+ code, _url.c_str());
+ }
+
+ } else {
+
+ // Transaction failed, pass on curl error.
+ gnash::log_error("CURL: %s",
+ curl_easy_strerror(
+ curl_msg->data.result));
+ _error = TU_FILE_OPEN_ERROR;
+ _running = false;
+
+ }
+
+ }
+
}
}
- [Gnash-commit] gnash ChangeLog libbase/curl_adapter.cpp,
Benjamin Wolsey <=