summaryrefslogtreecommitdiff
path: root/docs/tutorials/015/page21.html
diff options
context:
space:
mode:
authorjcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-04-09 18:24:25 +0000
committerjcej <jcej@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-04-09 18:24:25 +0000
commit0bb66cf8229926386eb3a0e9f0d0e7f734a10a35 (patch)
tree8ac05d430d0fa50be2f8447fdafc0191110b50eb /docs/tutorials/015/page21.html
parent3b78915d2effcdb7ae9d1a0d4f9bfc0c8c9063ae (diff)
downloadATCD-0bb66cf8229926386eb3a0e9f0d0e7f734a10a35.tar.gz
protocol stream should compress before encrypting
Diffstat (limited to 'docs/tutorials/015/page21.html')
-rw-r--r--docs/tutorials/015/page21.html6
1 files changed, 4 insertions, 2 deletions
diff --git a/docs/tutorials/015/page21.html b/docs/tutorials/015/page21.html
index 653147b88d6..daf4d2bc065 100644
--- a/docs/tutorials/015/page21.html
+++ b/docs/tutorials/015/page21.html
@@ -45,7 +45,8 @@ int <font color=#008888>Crypt::send</font>(ACE_Message_Block *message, ACE_Time_
<font color=red>// I suspect that some encryptors might change the data size.</font>
<font color=red>// It probably isn't safe to create a same-size destination buffer.</font>
- ACE_Message_Block * encrypted = new ACE_Message_Block( message->size() );
+ ACE_Message_Block * encrypted = new ACE_Message_Block(
+ message->size() +16 );
<font color=red>// Perform a bogus encryption algorithm and add our safety</font>
<font color=red>// signature. Adding the original data size is also probably</font>
@@ -73,7 +74,8 @@ int <font color=#008888>Crypt::recv</font>(ACE_Message_Block *message, ACE_Time_
<font color=red>// Create a destination for the decrypted data. The same</font>
<font color=red>// block size caveat exists of course.</font>
- ACE_Message_Block * decrypted = new ACE_Message_Block( message->size() );
+ ACE_Message_Block * decrypted = new ACE_Message_Block(
+ message->size() +16 );
<font color=red>// Check the signature as expected.</font>
if( <font color=#008888>ACE_OS::strncmp</font>( message->rd_ptr(), "<font color=green>ED:</font>", 3 ) )