[libsoup] Use soup_socket_listen_full() internally to propagate errors
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup] Use soup_socket_listen_full() internally to propagate errors
- Date: Mon, 25 Apr 2016 20:57:30 +0000 (UTC)
commit c1866cc4689db1417c6dd2ed6dc17e2185b2636a
Author: Stef Walter <stefw redhat com>
Date: Wed Mar 23 09:19:23 2016 +0100
Use soup_socket_listen_full() internally to propagate errors
Otherwise functions like soup_server_listen_all() don't return
an appropriate error when things fail.
https://bugzilla.gnome.org/show_bug.cgi?id=764057
libsoup/soup-server.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
---
diff --git a/libsoup/soup-server.c b/libsoup/soup-server.c
index 0c4201c..5783ccb 100644
--- a/libsoup/soup-server.c
+++ b/libsoup/soup-server.c
@@ -1730,15 +1730,13 @@ soup_server_listen_internal (SoupServer *server, SoupSocket *listener,
SOUP_SOCKET_IS_SERVER, &is_listening,
NULL);
if (!is_listening) {
- if (!soup_socket_listen (listener)) {
+ if (!soup_socket_listen_full (listener, error)) {
SoupAddress *saddr = soup_socket_get_local_address (listener);
- g_set_error (error,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- _("Could not listen on address %s, port %d"),
- soup_address_get_physical (saddr),
- soup_address_get_port (saddr));
+ g_prefix_error (error,
+ _("Could not listen on address %s, port %d: "),
+ soup_address_get_physical (saddr),
+ soup_address_get_port (saddr));
return FALSE;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]