*/
data_size = read(thread->sockfd, buffer + *leftover, buffer_len - *leftover);
if (data_size < 0) {
+ switch (errno) {
+#if defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN)
+ case EWOULDBLOCK:
+#endif
+ case EAGAIN:
+ /*
+ * We didn't read any data leave the buffers alone.
+ *
+ * i.e. if we had a partial packet in the buffer and we didn't read any data,
+ * then the partial packet is still left in the buffer.
+ */
+ return 0;
+
+ default:
+ break;
+ }
+
PDEBUG2("proto_radius_tcp got read error %zd", data_size);
return data_size;
}
*/
data_size = read(thread->sockfd, buffer + (*leftover), buffer_len - (*leftover));
if (data_size < 0) {
+ switch (errno) {
+#if defined(EWOULDBLOCK) && (EWOULDBLOCK != EAGAIN)
+ case EWOULDBLOCK:
+#endif
+ case EAGAIN:
+ /*
+ * We didn't read any data leave the buffers alone.
+ *
+ * i.e. if we had a partial packet in the buffer and we didn't read any data,
+ * then the partial packet is still left in the buffer.
+ */
+ return 0;
+
+ default:
+ break;
+ }
+
ERROR("proto_tacacs_tcp got read error (%zd) - %s", data_size, fr_syserror(errno));
return data_size;
}