I saw the original conversation of this thread and saw that this is what I
was trying to accomplish. I have pieced together a callback using the
example code provided by kan-4 and Wei Dai.
I'm having a problem, I need to intercept and further process the data
before returning. While stepping through code, the chunks are being seen by
the loop but I don't have the know-how to intercept the source or pump. My
question is this:
How do I access the data while stepping through the loop ?
Thanks
int InputReadFromStreamCallback(void *_ctx, std::string &buffer, int len)
{
InputReadCallbackContext *ctx = (InputReadCallbackContext *)_ctx;
try
{
while(ctx->pump->MaxRetrievable() < len) // don't need separate
source
pointer
{
if(ctx->pump->Pump(len / 5 + 1) == 0)
{
ctx->pump->PumpAll(); // causes MessageEnd() to
be called on compressor
/ decompressor
break;
}
ctx->pump->Flush(false); // flush output buffer
}
return ctx->source->Get((byte *)buffer.data(), (size_t) len);//
}
catch(CryptoPP::Exception &e)
{
std::string exep = e.GetWhat();
return -1;
}
}
--
View this message in context:
http://crypto-users.996303.n3.nabble.com/Callback-as-Sink-Revisited-tp4907.html
Sent from the Crypto++ Users mailing list archive at Nabble.com.
--
--
You received this message because you are subscribed to the "Crypto++ Users"
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at
http://www.cryptopp.com.
---
You received this message because you are subscribed to the Google Groups
"Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.