Forum Discussion
GuyG
Altocumulus
Dec 06, 2023Reading chunked data in iRule
Hey, I have an iRule in which I read all the payloads in each request and response. When there iRule receives chunked data, because there is no content-length I just use some big number as a limit...
GuyG
Altocumulus
Dec 13, 2023Splitting my reply to a few messages, because it didn't let me reply saying I was "Post Flooding".
Thanks for the reply.
Thanks for the reply.
This is sort of what I'm trying to do.
I have a simple iRule to start with where I'm trying to log the whole payload (all chunks combined) at the end of the response, while allowing the VS to send each chunk back to the client instead of buffering it.
GuyG
Altocumulus
Dec 13, 2023when HTTP_RESPONSE {
log local0.debug "Start of HTTP_RESPONSE"
set readSoFar 0
catch { HTTP::collect 1 }
}
when HTTP_RESPONSE_DATA {
log local0.debug "Start of HTTP_RESPONSE_DATA"
set prev_readSoFar $readSoFar
set readSoFar [HTTP::payload length]
log local0.debug "readSoFar: |$readSoFar|, prev_readSoFar: |$prev_readSoFar|"
if { $readSoFar == $prev_readSoFar } {
log local0.debug "Whole body: |[HTTP::payload]|"
} else {
HTTP::release
catch { HTTP::collect [expr {$readSoFar + 1}] }
}
}
when HTTP_RESPONSE_RELEASE {
log local0.debug "Start of HTTP_RESPONSE_RELEASE"
}Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects