mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 11:44:32 +03:00
Preallocate memory when SecStreamInBodyInspection is on. 20x speed improvement for 10mb upload. Also simplified modsecurity_request_body_to_stream.
This commit is contained in:
committed by
Felipe Zimmerle
parent
07c3659ddc
commit
afae690655
@@ -634,6 +634,7 @@ nextround:
|
||||
free(msr->stream_input_data);
|
||||
msr->stream_input_data = NULL;
|
||||
msr->stream_input_length = 0;
|
||||
msr->stream_input_allocated_length = 0;
|
||||
|
||||
msr->stream_input_data = (char *)malloc(size+1);
|
||||
|
||||
@@ -642,7 +643,8 @@ nextround:
|
||||
}
|
||||
|
||||
msr->stream_input_length = size;
|
||||
memset(msr->stream_input_data, 0x0, size+1);
|
||||
msr->stream_input_allocated_length = size + 1;
|
||||
memset(msr->stream_input_data, 0x0, size + 1);
|
||||
|
||||
msr->if_stream_changed = 1;
|
||||
|
||||
|
Reference in New Issue
Block a user