[farsight2/master] Emit GError in new domain on errors

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:25:05 PST 2008


---
 gst-libs/ext/fsupnp/fs-upnp-simple-igd.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/gst-libs/ext/fsupnp/fs-upnp-simple-igd.c b/gst-libs/ext/fsupnp/fs-upnp-simple-igd.c
index d4b3ed3..e868963 100644
--- a/gst-libs/ext/fsupnp/fs-upnp-simple-igd.c
+++ b/gst-libs/ext/fsupnp/fs-upnp-simple-igd.c
@@ -224,7 +224,7 @@ fs_upnp_simple_igd_class_init (FsUpnpSimpleIgdClass *klass)
   /**
    * FsUpnpSimpleIgd::error-mapping-port
    * @self: #FsUpnpSimpleIgd that emitted the signal
-   * @error: a #GError or %NULL if its a timeout
+   * @error: a #GError
    * @proto: The requested protocol
    * @external_port: the requested external port
    * @description: the passed description
@@ -545,8 +545,9 @@ _service_proxy_got_external_ip_address (GUPnPServiceProxy *proxy,
   else
   {
     g_return_if_fail (error);
-    g_signal_emit (self, signals[SIGNAL_ERROR], error->domain,
-        error);
+    g_signal_emit (self, signals[SIGNAL_ERROR_MAPPING_PORT], error->domain,
+        error, pm->mapping->protocol, pm->mapping->external_port,
+        pm->mapping->description);
   }
   g_clear_error (&error);
 }
@@ -656,11 +657,15 @@ _service_proxy_add_mapping_timeout (gpointer user_data)
 {
   struct ProxyMapping *pm = user_data;
   FsUpnpSimpleIgd *self = pm->proxy->parent;
+  const GError error = {FS_UPNP_SIMPLE_IGD_ERROR,
+                        FS_UPNP_SIMPLE_IGD_ERROR_TIMEOUT,
+                        "Timeout while mapping port"};
 
   stop_proxymapping (pm);
 
-  g_signal_emit (self, signals[SIGNAL_ERROR_MAPPING_PORT], 0,
-      NULL, pm->mapping->protocol, pm->mapping->external_port,
+  g_signal_emit (self, signals[SIGNAL_ERROR_MAPPING_PORT],
+      FS_UPNP_SIMPLE_IGD_ERROR, &error,
+      pm->mapping->protocol, pm->mapping->external_port,
       pm->mapping->description);
 
   return FALSE;
-- 
1.5.6.5




More information about the farsight-commits mailing list