- return -1;
-
- /* Read the data */
- if (socket->m_stream)
- ret = _GSocket_Recv_Stream(socket, buffer, size);
- else
- ret = _GSocket_Recv_Dgram(socket, buffer, size);
+ /* We no longer return here immediately, otherwise socket events would not be re-enabled! */
+ ret = -1;
+ else {
+ /* Read the data */
+ if (socket->m_stream)
+ ret = _GSocket_Recv_Stream(socket, buffer, size);
+ else
+ ret = _GSocket_Recv_Dgram(socket, buffer, size);
+ }