[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash/server/asobj NetConnection.cpp NetConnect...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash/server/asobj NetConnection.cpp NetConnect... |
Date: |
Sun, 25 Feb 2007 16:31:48 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 07/02/25 16:31:48
Modified files:
server/asobj : NetConnection.cpp NetConnection.h
Log message:
*now* NetConnection builds w/out CURL (run is another issue)
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.cpp?cvsroot=gnash&r1=1.23&r2=1.24
http://cvs.savannah.gnu.org/viewcvs/gnash/server/asobj/NetConnection.h?cvsroot=gnash&r1=1.17&r2=1.18
Patches:
Index: NetConnection.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- NetConnection.cpp 25 Feb 2007 16:21:21 -0000 1.23
+++ NetConnection.cpp 25 Feb 2007 16:31:48 -0000 1.24
@@ -14,7 +14,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: NetConnection.cpp,v 1.23 2007/02/25 16:21:21 strk Exp $ */
+/* $Id: NetConnection.cpp,v 1.24 2007/02/25 16:31:48 strk Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -44,8 +44,6 @@
static void netconnection_connect(const fn_call& fn);
static as_object* getNetConnectionInterface();
-#ifdef USE_CURL
-
/// \class NetConnection
/// \brief Opens a local connection through which you can play
/// back video (FLV) files from an HTTP address or from the local file
@@ -57,8 +55,13 @@
{
static bool initialized=0;
if ( ! initialized ) {
+#ifdef USE_CURL
+
// TODO: handle an error here
curl_global_init(CURL_GLOBAL_ALL);
+#else
+ log_error("Network support disabled (libcurl disabled at
compile-time)");
+#endif
initialized=1;
}
}
@@ -133,6 +136,7 @@
{
struct stat statbuf;
+#ifdef USE_CURL
CURLMcode mcode;
while (_running)
{
@@ -155,16 +159,19 @@
}
-
+#endif
}
+
NetConnection::NetConnection()
:
as_object(getNetConnectionInterface()),
_cache(NULL),
_cachefd(0),
_url(),
+#ifdef USE_CURL
_handle(NULL),
_mhandle(NULL),
+#endif
_running(false),
localFile(true),
netStreamObj(NULL),
@@ -173,9 +180,11 @@
}
NetConnection::~NetConnection() {
+#ifdef USE_CURL
curl_multi_remove_handle(_mhandle, _handle);
curl_easy_cleanup(_handle);
curl_multi_cleanup(_mhandle);
+#endif
fclose(_cache);
}
@@ -229,6 +238,7 @@
}
}
+#ifdef USE_CURL
ensure_libcurl_initialized();
_handle = curl_easy_init();
@@ -308,6 +318,7 @@
throw gnash::GnashException(curl_multi_strerror(mcode));
}
fill_cache(50000); // pre-cache 50 Kbytes
+#endif // defined USE_CURL
return true;
}
@@ -355,8 +366,6 @@
}
-#endif // HAVE_CURL_CURL_H
-
// Wrapper around dynamic_cast to implement user warning.
@@ -421,6 +430,7 @@
return o.get();
}
+
// extern (used by Global.cpp)
void netconnection_class_init(as_object& global)
{
@@ -442,5 +452,6 @@
}
+
} // end of gnash namespace
Index: NetConnection.h
===================================================================
RCS file: /sources/gnash/gnash/server/asobj/NetConnection.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- NetConnection.h 25 Feb 2007 16:21:21 -0000 1.17
+++ NetConnection.h 25 Feb 2007 16:31:48 -0000 1.18
@@ -14,7 +14,7 @@
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-/* $Id: NetConnection.h,v 1.17 2007/02/25 16:21:21 strk Exp $ */
+/* $Id: NetConnection.h,v 1.18 2007/02/25 16:31:48 strk Exp $ */
#ifndef __NETCONNECTION_H__
#define __NETCONNECTION_H__
@@ -23,14 +23,15 @@
#include "config.h"
#endif
-#ifdef USE_CURL
+#ifdef HAVE_CURL_CURL_H
#include <curl/curl.h>
+#endif
+
#include <stdexcept>
#include <cstdio>
#include <cerrno>
#include <sys/types.h>
#include <sys/stat.h>
-#endif
#include <string>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] gnash/server/asobj NetConnection.cpp NetConnect...,
Sandro Santilli <=