Update tls13_client.c

This commit is contained in:
Zhi Guan
2023-02-14 22:24:56 +08:00
parent e3a543ba1b
commit a8976d6a3e

View File

@@ -143,6 +143,20 @@ bad:
fd_set fds;
size_t sentlen;
if (!fgets(send_buf, sizeof(send_buf), stdin)) {
if (feof(stdin)) {
tls_shutdown(&conn);
goto end;
} else {
continue;
}
}
if (tls13_send(&conn, (uint8_t *)send_buf, strlen(send_buf), &sentlen) != 1) {
fprintf(stderr, "%s: send error\n", prog);
goto end;
}
FD_ZERO(&fds);
FD_SET(conn.sock, &fds);
#ifdef WIN32