aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_blocking.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/tls/tls_blocking.h')
-rw-r--r--src/tls/tls_blocking.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/tls/tls_blocking.h b/src/tls/tls_blocking.h
index 955413be1..917032164 100644
--- a/src/tls/tls_blocking.h
+++ b/src/tls/tls_blocking.h
@@ -36,9 +36,21 @@ class BOTAN_DLL Blocking_Client
std::function<std::string (std::vector<std::string>)> next_protocol =
std::function<std::string (std::vector<std::string>)>());
- size_t currently_readable() const { return m_plaintext.size(); }
+ /**
+ * Completes full handshake then returns
+ */
+ void do_handshake();
- size_t read(byte buf[], size_t buf_len); // blocking read
+ /**
+ * Number of bytes pending read in the plaintext buffer (bytes
+ * readable without blocking)
+ */
+ size_t pending() const { return m_plaintext.size(); }
+
+ /**
+ * Blocking read, will return at least 1 byte or 0 on connection close
+ */
+ size_t read(byte buf[], size_t buf_len);
void write(const byte buf[], size_t buf_len) { m_channel.send(buf, buf_len); }