fix libtls-standalone tests for tls_read and tls_write changed api

This commit is contained in:
Zhicheng Wei 2015-11-23 12:35:36 +08:00 committed by Brent Cook
parent 7a82b7c0fd
commit 84f0a9dbda

View File

@ -5,7 +5,7 @@ int main()
{
struct tls *tls;
struct tls_config *tls_config;
size_t written, read;
ssize_t written, read;
char buf[4096];
if (tls_init() != 0) {
@ -31,10 +31,10 @@ int main()
if (tls_connect(tls, "google.com", "443") != 0)
goto err;
if (tls_write(tls, "GET /\r\n", 7, &written) != 0)
if ((written = tls_write(tls, "GET /\r\n", 7)) < 0)
goto err;
if (tls_read(tls, buf, sizeof(buf), &read) != 0)
if ((read = tls_read(tls, buf, sizeof(buf))) < 0)
goto err;
buf[read - 1] = '\0';