Branch: Tag:


2019-06-18 14:24:03 by Stephen R. van den Berg <>

HTTP.Server.Request: Restore backward compatibility and fixes to Shuffler.

Changes to HTTP.Server.Request:
- Support set_mode() in HTTP.Server.Request to optionally enable
Shuffler to output the data on the wire. Without setting it, it
will revert to the old buffered-output method.
- Reinstate write-timeout on HTTP.Server.Request, make sure it works
in both classic and Shuffler modes.

Changes to Shuffler:
- Add automatic TCP_CORK support.
- Clean up code duplication between shuffler and sendfile.
- Move wrap_callback from a separate member to an optional argument
to add_source().
- Add support for Stdio.Buffer.
- Adding empty sources works consistently now.
- Fix broken cornercases when adding strings or memory regions.
- Fix dataloss when using non-blocking io on input files.
- Support starting in a file at the spot where the filepointer is.
- Add start/length arguments to the main Shuffle object, to skip and
limit in the entire concatenated output (needed for HTTP-range support).

171:    (find_identifier("set_read_callback",s->u.object->prog)==-1) )    return 0;    -  res = calloc( 1, sizeof( struct pf_source ) ); -  if( !res ) return NULL; +  if (!(res = calloc( 1, sizeof( struct pf_source)))) +  return 0;       res->len = len;    res->skip = start;