Use sendfile functions, only for big files.
This commit is contained in:
@@ -99,11 +99,14 @@ feature -- Output
|
|||||||
|
|
||||||
put_file_content (a_file: FILE; a_offset: INTEGER; a_byte_count: INTEGER)
|
put_file_content (a_file: FILE; a_offset: INTEGER; a_byte_count: INTEGER)
|
||||||
-- Send `a_byte_count' bytes from the content of file `a_file' starting at offset `a_offset'.
|
-- Send `a_byte_count' bytes from the content of file `a_file' starting at offset `a_offset'.
|
||||||
--| Could be redefine for optimization.
|
|
||||||
do
|
do
|
||||||
|
if a_byte_count > 500_000 then
|
||||||
last_target_call_succeed := False
|
last_target_call_succeed := False
|
||||||
target.put_file_content (a_file, a_offset, a_byte_count)
|
target.put_file_content (a_file, a_offset, a_byte_count)
|
||||||
last_target_call_succeed := not target.was_error
|
last_target_call_succeed := not target.was_error
|
||||||
|
else
|
||||||
|
Precursor (a_file, a_offset, a_byte_count)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
feature -- Status report
|
feature -- Status report
|
||||||
|
|||||||
Reference in New Issue
Block a user