Skip to content
Browse files

Write maximum of 16KB of data to an SSL connection per tick (fixes #233)

  • Loading branch information...
1 parent 62c5cce commit b237c0372f1d2752f2b18d8a6ed049b9ab23b52e @tmm1 tmm1 committed Sep 29, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 ext/ed.cpp
View
4 ext/ed.cpp
@@ -1202,16 +1202,18 @@ void ConnectionDescriptor::_DispatchCiphertext()
char BigBuf [2048];
bool did_work;
+ int num_chunks = 0;
do {
did_work = false;
// try to drain ciphertext
- while (SslBox->CanGetCiphertext()) {
+ while (SslBox->CanGetCiphertext() && num_chunks < 8) {
int r = SslBox->GetCiphertext (BigBuf, sizeof(BigBuf));
assert (r > 0);
_SendRawOutboundData (BigBuf, r);
did_work = true;
+ num_chunks += 1;
}
// Pump the SslBox, in case it has queued outgoing plaintext

0 comments on commit b237c03

Please sign in to comment.
Something went wrong with that request. Please try again.