diff options
author | Zhicheng Wei <zhicheng@opensourceforge.net> | 2015-11-23 12:35:36 +0800 |
---|---|---|
committer | Brent Cook <busterb@gmail.com> | 2015-11-23 02:11:02 -0600 |
commit | 84f0a9dbda1a0cae81299550757cd6ac8d349b67 (patch) | |
tree | d231938de5d85be449970257b445b1e5dd330ca2 | |
parent | 7a82b7c0fd619a3a815e1bbf2fe20cc23bdcf653 (diff) | |
download | portable-84f0a9dbda1a0cae81299550757cd6ac8d349b67.tar.gz portable-84f0a9dbda1a0cae81299550757cd6ac8d349b67.tar.bz2 portable-84f0a9dbda1a0cae81299550757cd6ac8d349b67.zip |
fix libtls-standalone tests for tls_read and tls_write changed api
-rw-r--r-- | libtls-standalone/tests/test.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libtls-standalone/tests/test.c b/libtls-standalone/tests/test.c index 1b8c761..4069332 100644 --- a/libtls-standalone/tests/test.c +++ b/libtls-standalone/tests/test.c | |||
@@ -5,7 +5,7 @@ int main() | |||
5 | { | 5 | { |
6 | struct tls *tls; | 6 | struct tls *tls; |
7 | struct tls_config *tls_config; | 7 | struct tls_config *tls_config; |
8 | size_t written, read; | 8 | ssize_t written, read; |
9 | char buf[4096]; | 9 | char buf[4096]; |
10 | 10 | ||
11 | if (tls_init() != 0) { | 11 | if (tls_init() != 0) { |
@@ -31,10 +31,10 @@ int main() | |||
31 | if (tls_connect(tls, "google.com", "443") != 0) | 31 | if (tls_connect(tls, "google.com", "443") != 0) |
32 | goto err; | 32 | goto err; |
33 | 33 | ||
34 | if (tls_write(tls, "GET /\r\n", 7, &written) != 0) | 34 | if ((written = tls_write(tls, "GET /\r\n", 7)) < 0) |
35 | goto err; | 35 | goto err; |
36 | 36 | ||
37 | if (tls_read(tls, buf, sizeof(buf), &read) != 0) | 37 | if ((read = tls_read(tls, buf, sizeof(buf))) < 0) |
38 | goto err; | 38 | goto err; |
39 | 39 | ||
40 | buf[read - 1] = '\0'; | 40 | buf[read - 1] = '\0'; |