From ff5688b09c21242c2a0bee70cdfd1ea50b06f4f0 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 16 Jul 2009 21:52:57 +0000 Subject: Client code is even cooler, it supports flushing data in case of buffering in the filter chain, I'm going to go ahead and make that optional coming up. --- src/client.cpp | 1 + src/client.h | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/src/client.cpp b/src/client.cpp index 24f9bfb..729526e 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -85,6 +85,7 @@ void Bu::Client::processOutput() { int nAmnt = (sWriteBuf.getSize()<2048)?(sWriteBuf.getSize()):(2048); int nReal = pTopStream->write( sWriteBuf.getStr(), nAmnt ); + pTopStream->flush(); sWriteBuf.trimFront( nReal ); //sWriteBuf.clear(); } diff --git a/src/client.h b/src/client.h index 7ba1ac5..72b1b05 100644 --- a/src/client.h +++ b/src/client.h @@ -73,6 +73,22 @@ namespace Bu pTopStream = pFlt; lFilts.prepend( pFlt ); } + + template + void pushFilter( p1t p1 ) + { + filter *pFlt = new filter( *pTopStream, p1 ); + pTopStream = pFlt; + lFilts.prepend( pFlt ); + } + + template + void pushFilter( p1t p1, p2t p2 ) + { + filter *pFlt = new filter( *pTopStream, p1, p2 ); + pTopStream = pFlt; + lFilts.prepend( pFlt ); + } private: typedef Bu::List FilterList; -- cgit v1.2.3