mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-27 22:46:15 +01:00
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
This commit is contained in:
parent
b65287fea5
commit
8520ae3ffa
@ -134,6 +134,15 @@ static gboolean g_socket_initable_init (GInitable *initable,
|
|||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error);
|
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
|
enum
|
||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
@ -4043,6 +4052,20 @@ g_socket_send_messages (GSocket *socket,
|
|||||||
gint flags,
|
gint flags,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GError **error)
|
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 (G_IS_SOCKET (socket), -1);
|
||||||
g_return_val_if_fail (num_messages == 0 || messages != NULL, -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)
|
if (errsv == EINTR)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (socket->priv->blocking &&
|
if (blocking &&
|
||||||
(errsv == EWOULDBLOCK ||
|
(errsv == EWOULDBLOCK ||
|
||||||
errsv == EAGAIN))
|
errsv == EAGAIN))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user