Update tls12_client.c

This commit is contained in:
Zhi Guan
2023-02-14 22:24:54 +08:00
parent 04016d7601
commit e3a543ba1b

View File

@@ -146,6 +146,19 @@ 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 (tls_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