aboutsummaryrefslogtreecommitdiffstats
path: root/doc/examples/tls_client.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'doc/examples/tls_client.cpp')
-rw-r--r--doc/examples/tls_client.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/doc/examples/tls_client.cpp b/doc/examples/tls_client.cpp
index d0a354e66..a787af1fe 100644
--- a/doc/examples/tls_client.cpp
+++ b/doc/examples/tls_client.cpp
@@ -188,7 +188,16 @@ void doit(RandomNumberGenerator& rng,
continue;
}
- client.send(buf, got);
+ if(got == 2 && (buf[0] == 'R' || buf[0] == 'r') && buf[1] == '\n')
+ {
+ std::cout << "Client initiated renegotiation\n";
+ client.renegotiate((buf[0] == 'R'));
+ }
+
+ if(buf[0] == 'H')
+ client.heartbeat(&buf[1], got-1);
+ else
+ client.send(buf, got);
}
}