Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 333 lines (304 sloc) 9.242 kb
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
1 /* Interface to sendfile system call for Yaws */
2 /* author: vinoski@ieee.org */
3 /* Created : 09 Nov 2008 by Steve Vinoski <vinoski@ieee.org> */
4
849c606 @capflam Fix option to enable/disable sendfile support in the configure script
capflam authored
5 #ifdef HAVE_SENDFILE
bedbc05 @tuncer add rebar support (Tuncer Ayaz and Steve Vinoski)
tuncer authored
6
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
7 #include <errno.h>
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
8 #include <stdint.h>
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
9 #include <sys/types.h>
10 #include <sys/stat.h>
11 #include <fcntl.h>
12 #include <string.h>
1c3afb1 @tuncer Fix 'implicit declaration of function' warnings
tuncer authored
13 #include <ctype.h>
14 #include <unistd.h>
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
15 #if defined(__linux__)
16 #include <sys/sendfile.h>
50472eb @vinoski changes to get yaws_sendfile working on FreeBSD, and some Makefile clean...
vinoski authored
17 #elif (defined(__APPLE__) && defined(__MACH__)) || defined(__FreeBSD__)
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
18 #include <sys/socket.h>
19 #include <sys/uio.h>
20 #endif
21
22 #include "erl_driver.h"
23 #ifndef ERL_DRV_NIL
24 #include "erl_driver_compat.h"
25 #endif
26
0911702 @tuncer Fix R15B compatibility (ErlDrvSizeT typedef)
tuncer authored
27 /*
28 * previously drv_output(..., int len)
29 * since R15B drv_output(..., ErlDrvSizeT len)
30 * use int if OTP < R15B
31 */
32 #if ERL_DRV_EXTENDED_MAJOR_VERSION < 2
33 typedef int ErlDrvSizeT;
34 #endif
35
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
36 #include "hashtable.h"
37
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
38 #define lshift_index(s, i, shift, t) (((t)((unsigned char*)(s))[i]) << (shift))
39 #define lshift32(s, i, shift) lshift_index(s, i, shift, uint32_t)
40 #define lshift64(s, i, shift) lshift_index(s, i, shift, uint64_t)
41 #define get_int32(s) (lshift32(s,0,24) | lshift32(s,1,16) | lshift32(s,2,8) | lshift32(s,3,0))
42 #define get_int64(s) (lshift64(s,0,56) | lshift64(s,1,48) | lshift64(s,2,40) | lshift64(s,3,32) | \
43 lshift64(s,4,24) | lshift64(s,5,16) | lshift64(s,6,8) | lshift64(s,7,0))
44
45 #define put_shift(i, s, idx, shift) (((unsigned char*)(s))[idx] = ((unsigned char)((i) >> (shift)) & 0XFF))
46 #define put_int32(i, s) do { \
47 put_shift(i, s, 0, 24); \
48 put_shift(i, s, 1, 16); \
49 put_shift(i, s, 2, 8); \
50 put_shift(i, s, 3, 0); \
51 } while(0)
52 #define put_int64(i, s) do { \
53 put_shift(i, s, 0, 56); \
54 put_shift(i, s, 1, 48); \
55 put_shift(i, s, 2, 40); \
56 put_shift(i, s, 3, 32); \
57 put_shift(i, s, 4, 24); \
58 put_shift(i, s, 5, 16); \
59 put_shift(i, s, 6, 8); \
60 put_shift(i, s, 7, 0); \
61 } while(0)
62
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
63 typedef union {
64 void* hashkey;
65 ErlDrvEvent ev_data;
66 #ifdef _LP64
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
67 uint64_t socket_fd;
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
68 #else
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
69 uint32_t socket_fd;
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
70 #endif
71 } SocketFd;
72
73 typedef struct {
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
74 off_t offset;
75 size_t count;
76 ssize_t total;
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
77 int file_fd;
78 } Transfer;
79
80 typedef struct hashtable* Transfers;
81
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
82 typedef struct {
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
83 ErlDrvPort port;
84 Transfers xfer_table;
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
85 } Desc;
86
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
87
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
88 static unsigned int fdhash(void* k)
89 {
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
90 return ((SocketFd*)&k)->socket_fd;
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
91 }
92
93 static int fdeq(void* k1, void* k2)
94 {
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
95 return k1 == k2;
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
96 }
97
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
98 static ErlDrvData yaws_sendfile_drv_start(ErlDrvPort port, char* buf)
99 {
100 Desc* d = (Desc*)driver_alloc(sizeof(Desc));
101 if (d == NULL) return (ErlDrvData) -1;
102 d->port = port;
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
103 d->xfer_table = create_hashtable(8192, fdhash, fdeq);
104 if (d->xfer_table == NULL) {
105 driver_free(d);
106 return (ErlDrvData) -1;
107 }
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
108 return (ErlDrvData)d;
109 }
110
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
111 static void yaws_sendfile_drv_stop(ErlDrvData handle)
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
112 {
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
113 Desc* d = (Desc*)handle;
114 hashtable_destroy(d->xfer_table, 1);
115 driver_free(d);
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
116 }
117
118 typedef union {
119 off_t offset;
120 size_t size;
121 ssize_t count;
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
122 uint64_t bits;
123 unsigned char bytes[8];
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
124 } U64_t;
125
126 typedef union {
127 char* buffer;
128 struct {
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
129 U64_t offset;
130 U64_t count;
131 uint32_t out_fd;
132 char filename[1];
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
133 }* args;
134 struct {
135 U64_t count;
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
136 uint32_t out_fd;
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
137 unsigned char success;
138 char errno_string[1];
139 }* result;
140 } Buffer;
141
0458c5d @vinoski change return type of sendfile set_error_buffer() (Tuncer Ayaz)
vinoski authored
142 static ErlDrvSizeT set_error_buffer(Buffer* b, int socket_fd, int err)
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
143 {
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
144 char* s, *t;
0458c5d @vinoski change return type of sendfile set_error_buffer() (Tuncer Ayaz)
vinoski authored
145 ErlDrvSizeT result_size = sizeof *(b->result);
f27ca2c @vinoski minor cleanup modifications
vinoski authored
146 memset(b->result, 0, result_size);
f01eff3 @vinoski fix overlooked endian issue with socket_fd in set_error_buffer() (thanks...
vinoski authored
147 put_int32(socket_fd, &(b->result->out_fd));
082f043 @vinoski if sendfile hits EOVERFLOW send the file from Erlang code instead
vinoski authored
148 s = erl_errno_id(err);
149 if (strcmp(s, "unknown") == 0 && err == EOVERFLOW) {
150 s = "EOVERFLOW";
151 }
152 for (t = b->result->errno_string; *s; s++, t++) {
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
153 *t = tolower(*s);
154 }
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
155 *t = '\0';
f27ca2c @vinoski minor cleanup modifications
vinoski authored
156 return result_size - 1 + t - b->result->errno_string;
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
157 }
158
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
159 static ssize_t yaws_sendfile_call(int out_fd, int in_fd,
160 off_t* offset, size_t count)
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
161 {
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
162 #if defined(__linux__)
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
163 off_t cur = *offset;
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
164 ssize_t retval = sendfile(out_fd, in_fd, offset, count);
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
165 if (retval >= 0 && retval != count) {
166 if (*offset == cur) {
167 *offset += retval;
168 }
169 retval = -1;
170 errno = EAGAIN;
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
171 } else if (retval < 0 && errno == EINTR) {
172 errno = EAGAIN;
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
173 }
174 return retval;
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
175 #elif defined(__APPLE__) && defined(__MACH__)
176 off_t len = count;
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
177 int retval = sendfile(in_fd, out_fd, *offset, &len, NULL, 0);
178 if (retval < 0 && (errno == EAGAIN || errno == EINTR)) {
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
179 *offset += len;
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
180 errno = EAGAIN;
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
181 }
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
182 return retval == 0 ? len : retval;
50472eb @vinoski changes to get yaws_sendfile working on FreeBSD, and some Makefile clean...
vinoski authored
183 #elif defined(__FreeBSD__)
184 off_t len = 0;
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
185 int retval = sendfile(in_fd, out_fd, *offset, count, NULL, &len, 0);
186 if (retval < 0 && (errno == EAGAIN || errno == EINTR)) {
50472eb @vinoski changes to get yaws_sendfile working on FreeBSD, and some Makefile clean...
vinoski authored
187 *offset += len;
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
188 errno = EAGAIN;
50472eb @vinoski changes to get yaws_sendfile working on FreeBSD, and some Makefile clean...
vinoski authored
189 }
190 return retval == 0 ? len : retval;
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
191 #else
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
192 errno = ENOSYS;
193 return -1;
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
194 #endif
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
195 }
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
196
0911702 @tuncer Fix R15B compatibility (ErlDrvSizeT typedef)
tuncer authored
197 static void yaws_sendfile_drv_output(ErlDrvData handle, char* buf,
198 ErlDrvSizeT buflen)
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
199 {
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
200 int fd, socket_fd;
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
201 Desc* d = (Desc*)handle;
202 Buffer b;
203 b.buffer = buf;
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
204 socket_fd = get_int32(&(b.args->out_fd));
1ede2f7 @vinoski open input file non-blocking and handle ready_input on it
vinoski authored
205 fd = open(b.args->filename, O_RDONLY | O_NONBLOCK);
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
206 if (fd < 0) {
0911702 @tuncer Fix R15B compatibility (ErlDrvSizeT typedef)
tuncer authored
207 ErlDrvSizeT out_buflen = set_error_buffer(&b, socket_fd, errno);
3dfcc9f @vinoski fix error check of sendfile call for Linux
vinoski authored
208 driver_output(d->port, buf, out_buflen);
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
209 } else {
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
210 Transfer* xfer;
211 SocketFd sfd;
212 sfd.socket_fd = socket_fd;
213 xfer = (Transfer*)hashtable_search(d->xfer_table, sfd.hashkey);
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
214 if (xfer == NULL) {
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
215 /* Transfer objects are intentionally not freed until the
216 driver stops, or if an insertion error occurs below. */
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
217 xfer = (Transfer*)malloc(sizeof(Transfer));
218 if (xfer == NULL) {
0911702 @tuncer Fix R15B compatibility (ErlDrvSizeT typedef)
tuncer authored
219 ErlDrvSizeT out_buflen = set_error_buffer(&b, socket_fd,
220 ENOMEM);
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
221 driver_output(d->port, buf, out_buflen);
222 return;
223 }
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
224 if (!hashtable_insert(d->xfer_table, sfd.hashkey, xfer)) {
0911702 @tuncer Fix R15B compatibility (ErlDrvSizeT typedef)
tuncer authored
225 ErlDrvSizeT out_buflen = set_error_buffer(&b, socket_fd,
226 ENOMEM);
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
227 driver_output(d->port, buf, out_buflen);
228 free(xfer);
229 return;
230 }
231 }
232 xfer->file_fd = fd;
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
233 xfer->offset = get_int64(&(b.args->offset.offset));
234 xfer->count = get_int64(&(b.args->count.size));
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
235 xfer->total = 0;
6c982a7 @vinoski do not use ERL_DRV_USE when de-selecting sendfile socket
vinoski authored
236 #if defined(ERL_DRV_USE) && defined(ERL_DRV_WRITE)
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
237 driver_select(d->port, sfd.ev_data, ERL_DRV_USE|ERL_DRV_WRITE, 1);
238 #else
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
239 driver_select(d->port, sfd.ev_data, DO_WRITE, 1);
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
240 #endif
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
241 }
242 }
243
3f6194f @klacke stream content with a timeout patch from Davide Marques
authored
244
da4e347 @vinoski Remove monitoring of input file, as this causes significant slowdown on ...
vinoski authored
245 static void yaws_sendfile_drv_ready_output(ErlDrvData handle, ErlDrvEvent ev)
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
246 {
da4e347 @vinoski Remove monitoring of input file, as this causes significant slowdown on ...
vinoski authored
247 Desc* d = (Desc*)handle;
c76f1ba @vinoski remove unneeded void* casts, and fix gcc -pedantic warnings
vinoski authored
248 ssize_t result;
249 off_t cur_offset;
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
250 Transfer* xfer;
251 SocketFd* sfd = (SocketFd*)&ev;
252 xfer = (Transfer*)hashtable_search(d->xfer_table, sfd->hashkey);
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
253 if (xfer == NULL) {
254 /* fatal error, something is very wrong */
255 driver_failure_atom(d->port, "socket_fd_not_found");
256 return;
257 }
c76f1ba @vinoski remove unneeded void* casts, and fix gcc -pedantic warnings
vinoski authored
258 cur_offset = xfer->offset;
082f043 @vinoski if sendfile hits EOVERFLOW send the file from Erlang code instead
vinoski authored
259 result = yaws_sendfile_call(sfd->socket_fd, xfer->file_fd,
260 &xfer->offset, xfer->count);
e6e0ded @vinoski Fix #187: handle EINPROGRESS and EALREADY in sendfile driver
vinoski authored
261 if (result < 0 && (errno == EAGAIN || errno == EWOULDBLOCK ||
262 errno == EINPROGRESS || errno == EALREADY)) {
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
263 if (xfer->offset != cur_offset) {
264 off_t written = xfer->offset - cur_offset;
265 xfer->count -= written;
266 xfer->total += written;
267 }
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
268 } else {
f27ca2c @vinoski minor cleanup modifications
vinoski authored
269 int save_errno = errno;
0911702 @tuncer Fix R15B compatibility (ErlDrvSizeT typedef)
tuncer authored
270 ErlDrvSizeT out_buflen;
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
271 char buf[36];
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
272 Buffer b;
273 b.buffer = buf;
274 memset(buf, 0, sizeof buf);
6c982a7 @vinoski do not use ERL_DRV_USE when de-selecting sendfile socket
vinoski authored
275 #ifdef ERL_DRV_WRITE
276 driver_select(d->port, ev, ERL_DRV_WRITE, 0);
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
277 #else
2e3798c @vinoski fix sendfile socket fd handling problems on 64-bit platforms
vinoski authored
278 driver_select(d->port, ev, DO_WRITE, 0);
3a5b906 @vinoski fix EINTR handling in sendfile driver
vinoski authored
279 #endif
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
280 close(xfer->file_fd);
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
281 if (result < 0) {
f27ca2c @vinoski minor cleanup modifications
vinoski authored
282 out_buflen = set_error_buffer(&b, sfd->socket_fd, save_errno);
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
283 } else {
93abf77 @vinoski modified the way data is passed between yaws_sendfile.erl and the sendfi...
vinoski authored
284 uint64_t total = xfer->total + result;
285 put_int64(total, &(b.result->count.count));
286 put_int32(sfd->socket_fd, &(b.result->out_fd));
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
287 b.result->success = 1;
288 b.result->errno_string[0] = '\0';
289 out_buflen = sizeof(*b.result);
290 }
15681a3 @vinoski fixes for improved sendfile driver concurrency
vinoski authored
291 xfer->file_fd = -1;
292 xfer->offset = xfer->count = xfer->total = 0;
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
293 driver_output(d->port, buf, out_buflen);
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
294 }
295 }
296
297 static ErlDrvEntry yaws_sendfile_driver_entry = {
298 NULL,
299 yaws_sendfile_drv_start,
300 yaws_sendfile_drv_stop,
301 yaws_sendfile_drv_output,
da4e347 @vinoski Remove monitoring of input file, as this causes significant slowdown on ...
vinoski authored
302 NULL,
935e67b @vinoski Handle EAGAIN by calling sendfile from only within ready_output.
vinoski authored
303 yaws_sendfile_drv_ready_output,
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
304 "yaws_sendfile_drv",
305 NULL,
306 NULL,
307 NULL,
9873a60 @tuncer Add missing driver entries
tuncer authored
308 NULL,
309 NULL,
310 NULL,
311 NULL,
312 NULL,
313 NULL,
314 ERL_DRV_EXTENDED_MARKER,
315 ERL_DRV_EXTENDED_MAJOR_VERSION,
316 ERL_DRV_EXTENDED_MINOR_VERSION,
317 0,
318 NULL,
319 NULL,
cd2deb9 @vinoski Add sendfile linked-in driver for use on Linux and OS X. It is not yet t...
vinoski authored
320 NULL
321 };
322
323 DRIVER_INIT(yaws_sendfile_drv)
324 {
325 return &yaws_sendfile_driver_entry;
326 }
bedbc05 @tuncer add rebar support (Tuncer Ayaz and Steve Vinoski)
tuncer authored
327
328 #else
329
330 #error "yaws_sendfile_drv not supported on this platform"
331
849c606 @capflam Fix option to enable/disable sendfile support in the configure script
capflam authored
332 #endif /* HAVE_SENDFILE */
Something went wrong with that request. Please try again.