aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/file.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-11-29 11:05:37 +0100
committerLukas Larsson <[email protected]>2011-12-02 10:39:38 +0100
commit1bbf8cee44b8836d66d289cc0b5b314ed83de821 (patch)
tree6d7ab44fd0d11c33f885816ddb12dfbc785f4540 /lib/kernel/src/file.erl
parent27faa34693f35b6aa41fa67cbfe365bd082a5757 (diff)
downloadotp-1bbf8cee44b8836d66d289cc0b5b314ed83de821.tar.gz
otp-1bbf8cee44b8836d66d289cc0b5b314ed83de821.tar.bz2
otp-1bbf8cee44b8836d66d289cc0b5b314ed83de821.zip
Remove header/trailer support
Since the API for headers/trailers seem to be very awkward to work with when using non-blocking io the feature is dropped for now. See unix_efile.c for more details.
Diffstat (limited to 'lib/kernel/src/file.erl')
-rw-r--r--lib/kernel/src/file.erl15
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl
index 19eaa7bfcc..0b0f91d86a 100644
--- a/lib/kernel/src/file.erl
+++ b/lib/kernel/src/file.erl
@@ -106,10 +106,7 @@
-type date_time() :: calendar:datetime().
-type posix_file_advise() :: 'normal' | 'sequential' | 'random'
| 'no_reuse' | 'will_need' | 'dont_need'.
--type sendfile_option() :: {chunk_size, pos_integer()} |
- {headers, Hdrs :: list(iodata())} |
- {trailers, Tlrs :: list(iodata())} |
- sf_nodiskio | sf_mnowait | sf_sync.
+-type sendfile_option() :: {chunk_size, non_neg_integer()}.
%%%-----------------------------------------------------------------
%%% General functions
@@ -1144,11 +1141,11 @@ sendfile(File, Sock, Offset, Bytes, Opts) ->
?MAX_CHUNK_SIZE;
true -> ChunkSize0
end,
- Headers = proplists:get_value(headers, Opts, []),
- Trailers = proplists:get_value(trailers, Opts, []),
- sendfile(File, Sock, Offset, Bytes, ChunkSize, Headers, Trailers,
- lists:member(sf_nodiskio,Opts),lists:member(sf_mnowait,Opts),
- lists:member(sf_sync,Opts)).
+ %% Support for headers, trailers and options has been removed because the
+ %% Darwin and BSD API for using it does not play nice with
+ %% non-blocking sockets. See unix_efile.c for more info.
+ sendfile(File, Sock, Offset, Bytes, ChunkSize, [], [],
+ false,false,false).
%% sendfile/2
-spec sendfile(Filename, Socket) ->