<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>


<style>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<p class="details" style="font-style: italic; color: #666;">
<a href="https://gitlab.com/cinoltus">Cinolt Yuklair</a> created an issue: <a href="https://gitlab.com/gnutls/gnutls/-/issues/1251">#1251</a>
</p>
<div></div>
<p dir="auto">Nonblocking socket operation is crucial for many applications, for example when simultaneously handling many socket connections.</p>
<p dir="auto">When handling a connection, it is necessary for the program to know when there is no more data to be read from the socket.</p>
<p dir="auto">With traditional sockets, the recv(2) system call indicates this case with the EAGAIN errno code.</p>
<p dir="auto">With GnuTLS, (when using gnutls_transport_set_int and default pull/push functions) there is the GNUTLS_E_AGAIN error code, which works some of the time, however I've noticed that there are certain cases when gnutls_record_recv will return this error code even when data has not been exhausted from the connection.</p>
<p dir="auto">Therefore, there is no way for the program to reliably know when data has been exhausted from the connection.</p>
<p dir="auto">In my opinion, gnutls_record_recv should return GNUTLS_E_AGAIN in the exact same semantics that recv returns EAGAIN. I don't see a reason why there are "extra" cases where GNUTLS_E_AGAIN is returned. In these cases, the program will think there is no more data and not handle connections correctly.</p>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
Reply to this email directly or <a href="https://gitlab.com/gnutls/gnutls/-/issues/1251">view it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can
<a href="https://gitlab.com/-/sent_notifications/e0c12d45cd9d6e183538c5ee53c49337/unsubscribe">unsubscribe</a>
from this thread or
adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Issue","url":"https://gitlab.com/gnutls/gnutls/-/issues/1251"}}</script>


</p>
</div>
</body>
</html>