httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Stoddard" <stodd...@raleigh.ibm.com>
Subject sendfile API
Date Mon, 01 Nov 1999 23:16:10 GMT
I'd like to see Apache 2.0 have support for the sendfile API. Here's what
I'm thinking...

Create a new feature macro, HAVE_SENDFILE that is defined for operating
systems that support a sendfile API.  The primary place where this would be
used is in the ap_send_fd() code in http_protocol.c. ap_send_fd() would look
something like this:

ap_send_fd(...) {
#ifdef HAVE_SENDFILE
    ap_sendfile(...);
#else
    ap_send_fd_length(...);
#endif
}

The parameters to ap_sendfile would be thus...

    ap_status_t     ap_send_file(ap_iol *fd, ap_file_t *fd, long size, const
char *header, long hdrlen, int flags);

Where
    ap_iol - iol_layer pointer
    fd - the file to send
    size - the size of the file
    header  - pointer to a buffer containing the headers to be sent before
the data
    headerLen - length of the header buffer to send
    flags - to be determined (e.g., flags whether to reuse the socket or
not, etc.)

I only included a header buffer because it seems to catch all the most
common cases. We could be more generic and include an io_vec for header
information; could include an io_vec for trailers as well, but that just
seems to be overkill.

Opinions? If I don;t hear anything, I'll commit the code I have working
under Windows and we'll go from there.

Bill




Mime
View raw message