I started some work on a concept rule that would allow you to take chunks of the HTTP data and store in separate variables (from some code from Deb a while back). The chunk part is working in a clean collect/release method, and I had a working model of storing the chunks in variables (though I've misplaced that code now). What I hadn't done yet is figure out how to after something like a response, re-gather all the data for release to the server. Anyway, if you want to fiddle, here's the start:
when HTTP_REQUEST {
if { [HTTP::method] == "POST" } {
set collected 0
if { [HTTP::header exists "Content-Length"] } {
set content_len [HTTP::header Content-Length]
} else {
set content_len 0
}
if { $content_len > 0 && $content_len < 524289 } {
set collect_len $content_len
} else {
set collect_len 524288
}
if { $collect_len > 0 } {
HTTP::collect $collect_len
}
}
}
when HTTP_REQUEST_DATA {
if { $content_len > 0 } {
set collected [expr {$collected + $collect_len}]
set remaining [expr {$content_len - $collected}]
if { $remaining > 0 } {
if { $remaining < $collect_len } {
HTTP::collect $remaining
HTTP::release
return
}
HTTP::collect $collect_len
}
}
}