|
From: <br...@us...> - 2009-05-13 04:22:30
|
Revision: 3908
http://openvrml.svn.sourceforge.net/openvrml/?rev=3908&view=rev
Author: braden
Date: 2009-05-13 04:22:22 +0000 (Wed, 13 May 2009)
Log Message:
-----------
Make sure NewStream gets called before calling DestroyStream in cases where no data was written to the stream.
Modified Paths:
--------------
trunk/ChangeLog
trunk/src/openvrml-player/curlbrowserhost.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2009-05-13 04:16:43 UTC (rev 3907)
+++ trunk/ChangeLog 2009-05-13 04:22:22 UTC (rev 3908)
@@ -1,5 +1,12 @@
2009-05-13 Braden McDaniel <br...@en...>
+ * src/openvrml-player/curlbrowserhost.cpp
+ (openvrml_player_curl_browser_host_curl_source_callback(gpointer)):
+ Make sure NewStream gets called before calling DestroyStream in
+ cases where no data was written to the stream.
+
+2009-05-13 Braden McDaniel <br...@en...>
+
* src/node/vrml97/image_texture.cpp
(image_texture_node::update_texture()): Make sure the stream is
valid before reading it.
Modified: trunk/src/openvrml-player/curlbrowserhost.cpp
===================================================================
--- trunk/src/openvrml-player/curlbrowserhost.cpp 2009-05-13 04:16:43 UTC (rev 3907)
+++ trunk/src/openvrml-player/curlbrowserhost.cpp 2009-05-13 04:22:22 UTC (rev 3908)
@@ -716,18 +716,34 @@
msg->easy_handle));
g_assert(stream_data);
//
- // If the stream data was never initialized, then new-stream was
- // never sent for it. In that case, we shouldn't send
- // destroy-stream.
+ // If the stream data was never initialized, we need to call
+ // NewStream before calling DestroyStream below.
//
- if (stream_data->initialized()) {
+ if (!stream_data->initialized()) {
+ const char * type = 0;
+ CURLcode result = curl_easy_getinfo(msg->easy_handle,
+ CURLINFO_CONTENT_TYPE,
+ &type);
+ if (!type) { type = "application/octet-stream"; }
+ const char * url = 0;
+ result = curl_easy_getinfo(msg->easy_handle,
+ CURLINFO_EFFECTIVE_URL,
+ &url);
dbus_g_proxy_call_no_reply(
browser_host->priv->browser,
- "DestroyStream",
- G_TYPE_UINT64, guint64(msg->easy_handle),
+ "NewStream",
+ G_TYPE_UINT64, reinterpret_cast<guint64>(msg->easy_handle),
+ G_TYPE_STRING, type,
+ G_TYPE_STRING, url,
G_TYPE_INVALID);
}
+ dbus_g_proxy_call_no_reply(
+ browser_host->priv->browser,
+ "DestroyStream",
+ G_TYPE_UINT64, reinterpret_cast<guint64>(msg->easy_handle),
+ G_TYPE_INVALID);
+
g_hash_table_remove(browser_host->priv->stream_data,
msg->easy_handle);
g_assert(curl_source->outstanding_handles > 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|