aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/tls_client.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-04-28 22:31:20 +0000
committerlloyd <[email protected]>2010-04-28 22:31:20 +0000
commit0f47cb60e703ca2de56286f07b4c9d91c7bba071 (patch)
tree5304fd84516c79f55e213755b2b2b99e6e65c9e0 /doc/examples/tls_client.cpp
parent6eec50d372143afcb3188f21d0991ace3e0d5e9e (diff)
parent50fc7b15553d888d95bee72972e53eae27a82c1f (diff)
propagate from branch 'net.randombit.botan' (head a5f25a3b954f24c5d07fa0dab6c4d76f63767165)
to branch 'net.randombit.botan.c++0x' (head a365694b70b4b84ca713272d56d496acca351cb5)
Diffstat (limited to 'doc/examples/tls_client.cpp')
-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)
{