When a file in TOSERVER direction is being stored and
libhtp or stream depth limit is reached,
it will be closed by HTPCallbackRequest without setting
any flags so the file state will be set to CLOSED
instead of TRUNCATED.
HtpRequestBodyHandlePUT(hstate, tx_ud, d->tx, (uint8_t *)d->data, (uint32_t)d->len);
}
+ } else {
+ if (tx_ud->tsflags & HTP_FILENAME_SET) {
+ SCLogDebug("closing file that was being stored");
+ (void)HTPFileClose(hstate, NULL, 0, FILE_TRUNCATED, STREAM_TOSERVER);
+ tx_ud->tsflags &= ~HTP_FILENAME_SET;
+ }
}
end: