Commit 60eef190 authored by Olivier Crête's avatar Olivier Crête
Browse files

pseudotcp: Treat EWOULDBLOCK as a success

This way, retransmissions can happen
parent 6661ce86
......@@ -2239,15 +2239,21 @@ packet(PseudoTcpSocket *self, guint32 seq, TcpFlags flags,
vector.size = len + HEADER_SIZE;
/* TODO: hook up to retry on EWOULDBLOCK */
n_messages = g_datagram_based_send_messages (priv->base_socket, &message, 1,
G_SOCKET_MSG_NONE, FALSE /* non-blocking */, NULL, &error);
n_messages = g_datagram_based_send_messages (priv->base_socket, &message,
1, G_SOCKET_MSG_NONE, 0 /* non-blocking */, NULL, &error);
/* Note: When len is 0, this is an ACK packet. We don't read the
return value for those, and thus we won't retry. So go ahead and treat
the packet as a success (basically simulate as if it were dropped),
which will prevent our timers from being messed up. */
if (n_messages != 1 && len > 0)
if (n_messages != 1 && len > 0) {
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_WOULD_BLOCK)) {
g_clear_error (&error);
return WR_SUCCESS;
}
g_clear_error (&error);
return WR_FAIL;
}
}
priv->t_ack = 0;
......
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