Skip to content

Commit 1fbfcba

Browse files
committed
Return -EAGAIN if send hello packet fails
1 parent b1e7487 commit 1fbfcba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libcurvecpr/lib/client.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
#include <sodium/crypto_box.h>
1111

12+
#include <errno.h>
13+
1214
static const unsigned char _zeros[128] = { 0 };
1315

1416
void curvecpr_client_new (struct curvecpr_client *client, const struct curvecpr_client_cf *cf)
@@ -70,7 +72,8 @@ int curvecpr_client_connected (struct curvecpr_client *client)
7072
curvecpr_bytes_copy(p.box, data + 16, 80);
7173
}
7274

73-
cf->ops.send(client, (const unsigned char *)&p, sizeof(struct curvecpr_packet_hello));
75+
if (cf->ops.send(client, (const unsigned char *)&p, sizeof(struct curvecpr_packet_hello)))
76+
return -EAGAIN;
7477

7578
return 0;
7679
}

0 commit comments

Comments
 (0)