aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/examples/tls_client.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/doc/examples/tls_client.cpp b/doc/examples/tls_client.cpp
index b60941eb2..5006e0a1a 100644
--- a/doc/examples/tls_client.cpp
+++ b/doc/examples/tls_client.cpp
@@ -31,6 +31,8 @@ int main()
std::string http_command = "GET /bitbashing\r\n";
tls.write((const byte*)http_command.c_str(), http_command.length());
+ u32bit total_got = 0;
+
while(true)
{
if(tls.is_closed())
@@ -38,9 +40,13 @@ int main()
byte buf[16+1] = { 0 };
u32bit got = tls.read(buf, sizeof(buf)-1);
- printf("Got %d bytes: %s", got, buf);
+ printf("%s", buf);
fflush(0);
+
+ total_got += got;
}
+
+ printf("Retrieved %d bytes total\n", total_got);
}
catch(std::exception& e)
{