diff options
| author | Garrett D'Amore <garrett@damore.org> | 2020-05-23 16:41:26 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2020-05-23 17:29:54 -0700 |
| commit | 20fd6f2b50b804deb9edf7a5ee82a32d8835138d (patch) | |
| tree | a3a1d3fa4c19365fb277f006d70a344406ced061 /src/supplemental/tls/tls_common.c | |
| parent | 01c087818a31519922b2c21d87c9ac3b35dbfb36 (diff) | |
| download | nng-20fd6f2b50b804deb9edf7a5ee82a32d8835138d.tar.gz nng-20fd6f2b50b804deb9edf7a5ee82a32d8835138d.tar.bz2 nng-20fd6f2b50b804deb9edf7a5ee82a32d8835138d.zip | |
Tests for sending large amounts of data over NNG TLS streams.
This also starts the test framework NNG streams, so that we can
test those more directly.
Diffstat (limited to 'src/supplemental/tls/tls_common.c')
| -rw-r--r-- | src/supplemental/tls/tls_common.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/supplemental/tls/tls_common.c b/src/supplemental/tls/tls_common.c index 7d89ea21..409c6600 100644 --- a/src/supplemental/tls/tls_common.c +++ b/src/supplemental/tls/tls_common.c @@ -1228,6 +1228,8 @@ nng_tls_engine_send(void *arg, const uint8_t *buf, size_t *szp) // We are committed at this point to sending out len bytes. // Update this now, so that we can use len to update. *szp = len; + conn->tcp_send_len += len; + NNI_ASSERT(conn->tcp_send_len <= NNG_TLS_MAX_SEND_SIZE); while (len > 0) { if (head >= tail) { @@ -1243,11 +1245,11 @@ nng_tls_engine_send(void *arg, const uint8_t *buf, size_t *szp) buf += cnt; head += cnt; head %= NNG_TLS_MAX_SEND_SIZE; - conn->tcp_send_len += cnt; - conn->tcp_send_head = head; len -= cnt; } + conn->tcp_send_head = head; + tls_tcp_send_start(conn); return (0); } |
