aboutsummaryrefslogtreecommitdiffstats
path: root/src/ssl/rec_wri.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-10-19 04:59:46 +0000
committerlloyd <[email protected]>2010-10-19 04:59:46 +0000
commitfafe810679e01949ddd8ac86c8367f3c15b0bedc (patch)
tree3f6c1784aa8bc718fbe3a19e5645521d26ceaf4a /src/ssl/rec_wri.cpp
parent221f9bd1469de9248b0233d366cdc2f0613fc182 (diff)
Make Record_Writer call a callback instead of writing directly to the socket
Diffstat (limited to 'src/ssl/rec_wri.cpp')
-rw-r--r--src/ssl/rec_wri.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ssl/rec_wri.cpp b/src/ssl/rec_wri.cpp
index f3525a7d1..59dead3cd 100644
--- a/src/ssl/rec_wri.cpp
+++ b/src/ssl/rec_wri.cpp
@@ -16,8 +16,9 @@ namespace Botan {
/**
* Record_Writer Constructor
*/
-Record_Writer::Record_Writer(Socket& sock) :
- socket(sock), buffer(DEFAULT_BUFFERSIZE)
+Record_Writer::Record_Writer(std::tr1::function<void (const byte[], size_t)> out) :
+ output_fn(out),
+ buffer(DEFAULT_BUFFERSIZE)
{
mac = 0;
reset();
@@ -188,7 +189,6 @@ void Record_Writer::send_record(byte type, const byte buf[], size_t length)
send_record(type, major, minor, buf, length);
else
{
-
mac->update_be(seq_no);
mac->update(type);
@@ -253,8 +253,8 @@ void Record_Writer::send_record(byte type, byte major, byte minor,
for(size_t i = 0; i != 2; ++i)
header[i+3] = get_byte<u16bit>(i, length);
- socket.write(header, 5);
- socket.write(out, length);
+ output_fn(header, 5);
+ output_fn(out, length);
}
/**