summaryrefslogtreecommitdiffstats
path: root/test/heartbeat_test.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-05-17 12:28:14 +0100
committerMatt Caswell <matt@openssl.org>2016-05-20 14:11:11 +0100
commit464175692f1f00a9e5a87f040d0c59184d63b53b (patch)
tree0770c84cf8e5eae29b9d5cf9fd5c168179ea4590 /test/heartbeat_test.c
parent72106aaab439eddc69df29aa328fb5eeb2086f84 (diff)
Simplify SSL BIO buffering logic
The write BIO for handshake messages is bufferred so that we only write out to the network when we have a complete flight. There was some complexity in the buffering logic so that we switched buffering on and off at various points through out the handshake. The only real reason to do this was historically it complicated the state machine when you wanted to flush because you had to traverse through the "flush" state (in order to cope with NBIO). Where we knew up front that there was only going to be one message in the flight we switched off buffering to avoid that. In the new state machine there is no longer a need for a flush state so it is simpler just to have buffering on for the whole handshake. This also gives us the added benefit that we can simply call flush after every flight even if it only has one message in it. This means that BIO authors can implement their own buffering strategies and not have to be aware of the state of the SSL object (previously they would have to switch off their own buffering during the handshake because they could not rely on a flush being received when they really needed to write data out). This last point addresses GitHub Issue #322. Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'test/heartbeat_test.c')
-rw-r--r--test/heartbeat_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/heartbeat_test.c b/test/heartbeat_test.c
index f92510ade8..906736c37e 100644
--- a/test/heartbeat_test.c
+++ b/test/heartbeat_test.c
@@ -101,7 +101,7 @@ static HEARTBEAT_TEST_FIXTURE set_up(const char *const test_case_name,
goto fail;
}
- if (!ssl_init_wbio_buffer(fixture.s, 1)) {
+ if (!ssl_init_wbio_buffer(fixture.s)) {
fprintf(stderr, "Failed to set up wbio buffer for test: %s\n",
test_case_name);
setup_ok = 0;