fix libtls-standalone tests for tls_read and tls_write changed api
This commit is contained in:
parent
7a82b7c0fd
commit
84f0a9dbda
@ -5,7 +5,7 @@ int main()
|
|||||||
{
|
{
|
||||||
struct tls *tls;
|
struct tls *tls;
|
||||||
struct tls_config *tls_config;
|
struct tls_config *tls_config;
|
||||||
size_t written, read;
|
ssize_t written, read;
|
||||||
char buf[4096];
|
char buf[4096];
|
||||||
|
|
||||||
if (tls_init() != 0) {
|
if (tls_init() != 0) {
|
||||||
@ -31,10 +31,10 @@ int main()
|
|||||||
if (tls_connect(tls, "google.com", "443") != 0)
|
if (tls_connect(tls, "google.com", "443") != 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (tls_write(tls, "GET /\r\n", 7, &written) != 0)
|
if ((written = tls_write(tls, "GET /\r\n", 7)) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
if (tls_read(tls, buf, sizeof(buf), &read) != 0)
|
if ((read = tls_read(tls, buf, sizeof(buf))) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
buf[read - 1] = '\0';
|
buf[read - 1] = '\0';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user