aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers
AgeCommit message (Collapse)Author
2012-01-23Merge branch 'jz/error-logic-efile_sendfile' into maintHenrik Nord
* jz/error-logic-efile_sendfile: erts: minor fix for unnecessary condition OTP-9872
2012-01-23Merge branch 'jz/sendfile_chunk_size' into maintHenrik Nord
* jz/sendfile_chunk_size: erts: change SENDFILE_CHUNK_SIZE from signed to unsigned Conflicts: erts/emulator/drivers/unix/unix_efile.c OTP-9872
2012-01-18Merge branch 'raimo/64-bit-efile_drv/OTP-9820' into maintErlang/OTP
* raimo/64-bit-efile_drv/OTP-9820: file_SUITE: Assume 64-bit windows has enough memory erts: Badarg if port output overflows iov_len prim_file_SUITE: large_file success depends on wordsize file_SUITE: Increase timeout for large_file file_SITE,prim_file_SUITE: Accept old OpenBSD pecularity prim_file_SUITE: large_write - meaner test data and check result content file_SUITE: large_write - check mem size before creating huge binary erts: rewrite efile_writev to handle partial writes correctly erts: Bugfix - driver_deq freed wrong length due to short type (int) prim_file_SUITE: Add large_write/1 file_SUITE: Add large_write/1 file_SUITE: Refactor large_file/1 file_SUITE: Fix unix_free/1
2011-12-20erts: rewrite efile_writev to handle partial writes correctlyRaimo Niskanen
2011-12-19erts: Better suppression of uninitialised sctp_sndrcvinfoSverker Eriksson
2011-12-09Update copyright yearsBjörn-Egil Dahlberg
2011-12-09Merge branch 'raimo/64-bit-driver-api/OTP-9795'Björn Gustavsson
* raimo/64-bit-driver-api/OTP-9795: (22 commits) driver_SUITE.erl: Fix sys info drivers emulator test drivers: Conform to updated driver API runtime_tools's drivers: Conform to updated driver API ws's xwe_driver.c: Conform to updated driver API megaco's flex scanner: Conform to updated driver API seq_trace_SUITE_data/echo_drv.c: Conform to updated driver API erl_interface tests: Conform port_call_drv.c updated driver API erl_drv_thread_SUITE_data/testcase_driver.c: Conform to updated driver API float_SUITE_data/fp_drv.c: Conform to updated driver API port_SUITE_data/*_drv.c: Conform to updated driver API port_bif_SUITE_data/control_drv.c: Conform to updated driver API send_term_SUITE_data/send_term_drv.c: Conform to updated driver API system_profile_SUITE_data/echo_drv.c: Conform to updated driver API trace_port_SUITE_data/echo_drv.c: Conform to updated driver API Remove support for old drivers without ERL_DRV_EXTENDED_MARKER built-in drivers: Add ERL_DRV_EXTENDED_MARKER and version numbers Bump driver version to 2.0 erl_driver.h: Enlarge type on return value from call erl_driver.h: Enlarge types on driver callbacks output, control and call erl_driver.h: Enlarge types in driver output functions ... Conflicts: erts/emulator/test/driver_SUITE_data/monitor_drv.c erts/emulator/test/driver_SUITE_data/timer_drv.c
2011-12-09built-in drivers: Add ERL_DRV_EXTENDED_MARKER and version numbersBjörn Gustavsson
2011-12-09erl_driver.h: Enlarge types on driver callbacks output, control and callRaimo Niskanen
2011-12-08Merge branch 'ta/sendfile/OTP-9240'Lukas Larsson
* ta/sendfile/OTP-9240: Do not use async threads on DARWIN Fix cleanup when sendfile process crashes Return {error,closed} from sendfile if closed Do not use SFV_NOWAIT as it does not exist on all solaris Clarify some code comments Make solaris use sendfilev
2011-12-08Merge branch 'sverk/misc-valgrind-fixes'Sverker Eriksson
* sverk/misc-valgrind-fixes: erts: Suppress valgrind warning about syscall sendmsg erts: Fix memory leak in test drivers erts: Small fix in inet_drv.c:sctp_set_opts
2011-12-08Do not use async threads on DARWINLukas Larsson
2011-12-08Fix cleanup when sendfile process crashesLukas Larsson
When sendfile crashes during a send there should be no error_logger printouts about stolen fds.
2011-12-08Merge branch 'egil/file-info-opt-utc/OTP-7687'Björn-Egil Dahlberg
* egil/file-info-opt-utc/OTP-7687: (39 commits) Remove time_t specific test in prim_file_SUITE Update prim_file.beam and prim_zip.beam Add types for posixtime_to_universaltime and the reverse Set BASEYEAR to 1902 Set lower limit of years handled to 1601 Emulate localtime, gmtime and mktime to enable negative time_t Document file:*_file_info/2 Fix compiler warning in unix_efile.c Change name of bif universaltime_to_seconds/1 Change options to prim_file:*_file_info/* Remove dead code Catch errors from prim_file:*_file_info Testcase for utc <-> seconds conversion Fix negative time in seconds_to_universaltime/1 Remove OS taint from datetime conversion Add utc <-> seconds conversions bifs Let prim_file validate ctime in file_info Teach #file_info spec unix epochs for file times Add file_info_opt tests in prim_file_SUITE unix_efile: Zero is a valid number in utime ... Conflicts: erts/emulator/beam/erl_time_sup.c erts/emulator/sys/win32/erl_win_sys.h erts/emulator/sys/win32/sys_time.c
2011-12-08Fix compiler warning in unix_efile.cBjörn-Egil Dahlberg
2011-12-08unix_efile: Zero is a valid number in utimeBjörn-Egil Dahlberg
Both mtime and atime were incorrectly checked for zero
2011-12-08Teach windows sys_localtime_rBjörn-Egil Dahlberg
2011-12-07Return {error,closed} from sendfile if closedLukas Larsson
If the socket is closed by the remote end, sendfile now returns {error,closed}.
2011-12-07erl_driver.h: Enlarge types in driver queue and alloc functionsRaimo Niskanen
2011-12-07erl_driver.h: Use ErlDrvSizeT for size field in ErlIOVecRaimo Niskanen
2011-12-07erts: Suppress valgrind warning about syscall sendmsgSverker Eriksson
Valgrind complains: "Syscall param socketcall.sendmsg(msg.msg_control) points to uninitialised byte(s)". Seems valgrind do not know which bytes of msg_control are padding.
2011-12-07Do not use SFV_NOWAIT as it does not exist on all solarisLukas Larsson
2011-12-06erts: Small fix in inet_drv.c:sctp_set_optsSverker Eriksson
2011-12-06erts: minor fix for unnecessary conditionJovi Zhang
In "while (retval != -1 && retval == SENDFILE_CHUNK_SIZE)", "retval != -1" is pointless.
2011-12-06erts: change SENDFILE_CHUNK_SIZE from signed to unsignedJovi Zhang
It's reasonable to use UL in SENDFILE_CHUNK_SIZE
2011-12-05Clarify some code commentsLukas Larsson
Thanks Tuncer Ayaz
2011-12-05Make solaris use sendfilevLukas Larsson
sendfilev is a richer API which allows us to do non blocking TCP on solaris. The normal sendfile API seems to have some issue with non blocking sockets and the return value of sendfile.
2011-12-05honor packet_size for http packet parsing to fix OTP-9389Steve Vinoski
Allow applications to use a packet_size setting on a socket to control acceptable HTTP header line length. This gives them the ability to accept HTTP headers larger than the default settings allow, but also lets them avoid DOS attacks by accepting header lines only up to whatever length they wish to allow. Without this change, if an HTTP request/response line or header arrives on a socket in http, http_bin, httph, or httph_bin parsing mode, and the request/response line or header is too long to fit into a default inet_drv buffer of 1460 bytes, an unexpected error occurs. These problems were described and discussed on erlang-questions in June 2011 in this thread: http://erlang.org/pipermail/erlang-questions/2011-June/059563.html In the original code, no buffer reallocation occurs to enlarge the buffer, even if packet_size or line_length are set in a way that should allow the HTTP data to be parsed properly. The only available workaround was to collect headers and parse them using erlang:decode_packet, but that approach has drawbacks such as having to collect all HTTP header data before it can be handed to decode_packet for correct parsing, and also requiring each and every Erlang web server developer/maintainer to add the workaround to his or her web server. Change the packet parser to honor the packet_size setting for HTTP parsing. If packet_size is set, and an HTTP request/response or header line exceeds the default 1460 byte TCP buffer limit, return an indication to tcp_remain that it should realloc the buffer to enlarge it to packet_size. Also fix the HTTP parsing code to properly honor line_length by truncating any HTTP request/response or header lines that exceed that setting. For backward compatibility, default behavior is unchanged; if an application wants to be able to accept long HTTP header lines, it must set packet_size to an appropriate value. Buffer reallocation occurs only when needed, so the original default buffer size in the code is still the default. Make the line mode parsing honor packet_size as well, for consistency. Add new regression tests to the emulator decode_packet suite and also to the kernel gen_tcp_misc suite. The documentation for packet_size in inet:setopts/2 is already sufficient. Many thanks to Sverker Eriksson for his guidance on how to best fix this bug and also for reviewing a number of patch attempts prior to this one.
2011-12-02Fix undefined ctime for invalid file handlesBjörn-Egil Dahlberg
* ctime were never defined for invalid file handles * fix epoch <-> fileinfo conversions
2011-12-02efile_drv: Fix casting between Sint64 and time_tBjörn-Egil Dahlberg
2011-12-02Fix EPOCH <-> FILETIME conversionBjörn-Egil Dahlberg
2011-12-02Teach win32 efile driver epochsBjörn-Egil Dahlberg
Conflicts: erts/emulator/drivers/win32/win_efile.c
2011-12-02Use epoch seconds instead of datetime()Björn-Egil Dahlberg
First stage in utc-time for prim_file.
2011-12-02Iron out bugs in Win64 found in daily buildsPatrik Nyblom
Almost all uses of the 'long' datatype is removed from VM and tests Emulator test now runs w/o drivers crashing Nasty abs bug fixed in VM as well as type errors in allocator debug functions Still one allocator test that fails, domain knowledge is needed to fix that. Fix type inconsistency in beam_load causing crashes
2011-12-02Get cerl and distribution working in Win64Patrik Nyblom
Can still not setup -a, but cerl works.
2011-12-02Build Win64 Erlang emulator using MSYSunknown
Still does not run, just compiles.
2011-12-02Merge branch 'ta/sendfile/OTP-9240'Lukas Larsson
* ta/sendfile/OTP-9240: (31 commits) Add sendfile server printouts Skip recv/send during tests for fallback platforms Remove header/trailer support Remove windows implementation Expand sendfile documentation Only allow tcp sockets as target for sendfile Move sendfile api to file module Preliminary work on header/trailer Use free_sendfile explicitly for non-async Remove debug printouts Add tests for send/recv/sendfile interactions Remove tests for file_server sendfile sendfile caller now has to be the controlling_process Remove support for file_server, sendfile has to be raw Set chunk size to 3 GB Change type of fd to be ErlDrvEvent Add ifdef's for HAVE_SENDFILE Fix freebsd support for sendfile Change nbytes to 64 bit Implement ignorefd for TCP ...
2011-12-02Remove header/trailer supportLukas Larsson
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.
2011-12-02Remove windows implementationLukas Larsson
2011-12-01Preliminary work on header/trailerLukas Larsson
Have to figure out how to represent progress in header writing when using non-blocking, not sure how to do this.
2011-12-01Use free_sendfile explicitly for non-asyncLukas Larsson
This is needed because aync job will not call free_sendfile if there is an async_ready callback.
2011-12-01Remove debug printoutsLukas Larsson
2011-12-01Set chunk size to 3 GBLukas Larsson
It is not possible to use the maximum size_t/off_t for the chunks as that causes sendfile to return einval. 3GB seems to work on all *nix platforms.
2011-12-01Change type of fd to be ErlDrvEventLukas Larsson
2011-12-01Add ifdef's for HAVE_SENDFILELukas Larsson
2011-12-01Fix freebsd support for sendfileLukas Larsson
2011-12-01Change nbytes to 64 bitLukas Larsson
2011-12-01Implement ignorefd for TCPLukas Larsson
Ignore fd is a feature used by sendfile to temporarily remove all driver_select calls on that fd so that another driver can select on it. It also delays all actions which sends or receives data in that fd until in the fd is no longer ignored. Only the controlling_process should use the feature as it is otherwise possible that the ignore will never be cleaned up and hence create a memory leak in the driver. An ignored driver will not detect that an fd has been closed until it is unignored.
2011-12-01Fix offset calculation for darwinLukas Larsson
2011-12-01Fix cleanup for sendfileLukas Larsson