Commit 8520ae3f authored by Philip Withnall's avatar Philip Withnall
Browse files

gsocket: Factor out blocking parameter from g_socket_send_messages()

This will make future API additions easier. The factored version is
internal for the time being.

https://bugzilla.gnome.org/show_bug.cgi?id=751924
parent b65287fe
......@@ -134,6 +134,15 @@ static gboolean g_socket_initable_init (GInitable *initable,
GCancellable *cancellable,
GError **error);
static gint
g_socket_send_messages_with_blocking (GSocket *socket,
GOutputMessage *messages,
guint num_messages,
gint flags,
gboolean blocking,
GCancellable *cancellable,
GError **error);
enum
{
PROP_0,
......@@ -4043,6 +4052,20 @@ g_socket_send_messages (GSocket *socket,
gint flags,
GCancellable *cancellable,
GError **error)
{
return g_socket_send_messages_with_blocking (socket, messages, num_messages,
flags, socket->priv->blocking,
cancellable, error);
}
static gint
g_socket_send_messages_with_blocking (GSocket *socket,
GOutputMessage *messages,
guint num_messages,
gint flags,
gboolean blocking,
GCancellable *cancellable,
GError **error)
{
g_return_val_if_fail (G_IS_SOCKET (socket), -1);
g_return_val_if_fail (num_messages == 0 || messages != NULL, -1);
......@@ -4183,7 +4206,7 @@ g_socket_send_messages (GSocket *socket,
if (errsv == EINTR)
continue;
if (socket->priv->blocking &&
if (blocking &&
(errsv == EWOULDBLOCK ||
errsv == EAGAIN))
{
......
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