Commit 4151e9b8 authored by Jorn Baayen's avatar Jorn Baayen

2008-11-18 Jorn Baayen <jorn.baayen@collabora.co.uk>

	* AUTHORS:

	New e-mail address.

	* configure.ac:

	Depend on glib 2.18.

	* libgupnp/gupnp-error-private.h:
	* libgupnp/gupnp-error.c (_gupnp_error_set_server_error),
	(_gupnp_error_new_server_error):
	* libgupnp/gupnp-service-info.c
	(gupnp_service_info_get_introspection), (got_scpd_url):
	* libgupnp/gupnp-service-proxy.c (check_action_response):

	Use g_set_error_literal(). (instead of our own home-cooked
	set_error_literal())

	Mark private error functions as G_GNUC_INTERNAL.



git-svn-id: https://svn.o-hand.com/repos/gupnp/trunk/gupnp@1367 d8cb91d7-bff9-0310-92b9-80b65e4482b2
parent 3849fd2f
Jorn Baayen <jorn@openedhand.com>
Jorn Baayen <jorn.baayen@collabora.co.uk>
Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
2008-11-18 Jorn Baayen <jorn.baayen@collabora.co.uk>
* AUTHORS:
New e-mail address.
* configure.ac:
Depend on glib 2.18.
* libgupnp/gupnp-error-private.h:
* libgupnp/gupnp-error.c (_gupnp_error_set_server_error),
(_gupnp_error_new_server_error):
* libgupnp/gupnp-service-info.c
(gupnp_service_info_get_introspection), (got_scpd_url):
* libgupnp/gupnp-service-proxy.c (check_action_response):
Use g_set_error_literal(). (instead of our own home-cooked
set_error_literal())
Mark private error functions as G_GNUC_INTERNAL.
2008-11-18 Jorn Baayen <jorn.baayen@collabora.co.uk>
* libgupnp/gupnp-service-proxy.c (subscribe_got_response):
......
......@@ -12,7 +12,8 @@ AC_PROG_LIBTOOL
AC_FUNC_MMAP
AC_SYS_LARGEFILE
PKG_CHECK_MODULES(LIBGUPNP, gobject-2.0 >= 2.9.1 \
PKG_CHECK_MODULES(LIBGUPNP, glib-2.0 >= 2.18 \
gobject-2.0 >= 2.18 \
gmodule-2.0 \
gssdp-1.0 >= 0.6 \
libsoup-2.4 >= 2.4.1 \
......
......@@ -26,18 +26,12 @@
G_BEGIN_DECLS
void
set_error_literal (GError **error,
GQuark error_quark,
int code,
const char *message);
G_GNUC_INTERNAL void
_gupnp_error_set_server_error (GError **error,
SoupMessage *msg);
void
set_server_error (GError **error,
SoupMessage *msg);
GError *
new_server_error (SoupMessage *msg);
G_GNUC_INTERNAL GError *
_gupnp_error_new_server_error (SoupMessage *msg);
G_END_DECLS
......
......@@ -81,24 +81,6 @@ gupnp_control_error_quark (void)
return quark;
}
/* Missing g_set_error_literal() */
void
set_error_literal (GError **error,
GQuark error_quark,
int code,
const char *message)
{
if (error == NULL)
return;
if (*error == NULL) {
*error = g_error_new_literal (error_quark,
code,
message);
} else
g_warning ("Error already set.");
}
/* Soup status code => GUPnPServerError */
static int
code_from_status_code (int status_code)
......@@ -117,18 +99,18 @@ code_from_status_code (int status_code)
/* Set status of @msg to @error */
void
set_server_error (GError **error,
SoupMessage *msg)
_gupnp_error_set_server_error (GError **error,
SoupMessage *msg)
{
set_error_literal (error,
GUPNP_SERVER_ERROR,
code_from_status_code (msg->status_code),
msg->reason_phrase);
g_set_error_literal (error,
GUPNP_SERVER_ERROR,
code_from_status_code (msg->status_code),
msg->reason_phrase);
}
/* Create a #GError with status of @msg */
GError *
new_server_error (SoupMessage *msg)
_gupnp_error_new_server_error (SoupMessage *msg)
{
return g_error_new_literal (GUPNP_SERVER_ERROR,
code_from_status_code (msg->status_code),
......
......@@ -584,7 +584,7 @@ gupnp_service_info_get_introspection (GUPnPServiceInfo *info,
status = soup_session_send_message (session, msg);
if (!SOUP_STATUS_IS_SUCCESSFUL (status)) {
set_server_error (error, msg);
_gupnp_error_set_server_error (error, msg);
g_object_unref (msg);
......@@ -647,7 +647,7 @@ got_scpd_url (SoupSession *session,
"Could not parse SCPD");
}
} else
error = new_server_error (msg);
error = _gupnp_error_new_server_error (msg);
data->info->priv->pending_gets =
g_list_remove (data->info->priv->pending_gets, data);
......
......@@ -890,7 +890,7 @@ check_action_response (GUPnPServiceProxy *proxy,
case SOUP_STATUS_INTERNAL_SERVER_ERROR:
break;
default:
set_server_error (error, action->msg);
_gupnp_error_set_server_error (error, action->msg);
return NULL;
}
......@@ -906,7 +906,7 @@ check_action_response (GUPnPServiceProxy *proxy,
GUPNP_SERVER_ERROR_INVALID_RESPONSE,
"Could not parse SOAP response");
} else {
set_error_literal
g_set_error_literal
(error,
GUPNP_SERVER_ERROR,
GUPNP_SERVER_ERROR_INTERNAL_SERVER_ERROR,
......@@ -987,10 +987,10 @@ check_action_response (GUPnPServiceProxy *proxy,
if (desc == NULL)
desc = g_strdup (action->msg->reason_phrase);
set_error_literal (error,
GUPNP_CONTROL_ERROR,
code,
desc);
g_set_error_literal (error,
GUPNP_CONTROL_ERROR,
code,
desc);
g_free (desc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment