You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Jiří Podhorský <po...@gmail.com> on 2015/07/03 14:44:43 UTC

Get a binary body in plugin of traffic server

Hello,

can be binary body of response accessed from some plugin, for example
jpg picture?



I tried to look for it in TransformationPlugin
https://docs.trafficserver.apache.org/en/latest/api/classatscppapi_1_1TransformationPlugin.html,
but there is only sentence about producing binary body:
"size_t atscppapi::TransformationPlugin::produce ( const std::string &  )
This method is how a TransformationPlugin will produce output for the
downstream transformation plugin, if you need to produce binary data
this can still be done with strings by a call to string::assign() or
by constructing a string with string::string(char *, size_t). "

but method "consume" for loading data is not called for binary data in
my testing plugin, only for plaintext pages.

That is strange, because transformation plugin can receive and send
messages from and to another transformation plugin. So, next
transformation plugin should be able to accept binary body, when I can
send it by "produce" method.

Can you explain it for me?



I'm using trafficserver 5.3.


Thanks.
Jiri