cubemap
2 years agoUpdate performance claims in README.
Steinar H. Gunderson [Sun, 22 Apr 2018 15:18:33 +0000 (17:18 +0200)]
Update performance claims in README.

Update README; 10gig isn't even hard anymore these days, the kernels are so
fast. Andre Tomt verified ~40 Gbit/sec with kTLS on a quadcore 45W Xeon D,
with no particular tuning.

2 years agoFix timeout behavior with persistent connections.
Steinar H. Gunderson [Sun, 22 Apr 2018 14:34:00 +0000 (16:34 +0200)]
Fix timeout behavior with persistent connections.

We'd either never time out clients (if the expiry check happened
while they were receiving a request) or time them out too soon
(based on the connection time instead of the time of last request end).

2 years agoMake the Munin plugin count downloading fragments as equivalent to the stream.
Steinar H. Gunderson [Tue, 17 Apr 2018 16:10:06 +0000 (18:10 +0200)]
Make the Munin plugin count downloading fragments as equivalent to the stream.

This doesn't really fix the full issue of counting HLS clients, but at least
it's a start.

2 years agoUnbreak header parsing; it was broken by the case-sensitivity fixes.
Steinar H. Gunderson [Mon, 16 Apr 2018 19:06:25 +0000 (21:06 +0200)]
Unbreak header parsing; it was broken by the case-sensitivity fixes.

2 years agoAdd a missing #include.
Steinar H. Gunderson [Tue, 10 Apr 2018 16:00:20 +0000 (18:00 +0200)]
Add a missing #include.

Reported by Marcus Nilsen.

2 years agoFlush after writing pending TLS data.
Steinar H. Gunderson [Tue, 10 Apr 2018 15:58:38 +0000 (17:58 +0200)]
Flush after writing pending TLS data.

Cuts something like 600 ms away from the initial TLS handshake,
as we kept having unflushed data that would require waiting for
the 200 ms TCP_CORK timer.

2 years agoMake HTTP header parsing case-insensitive.
Steinar H. Gunderson [Mon, 9 Apr 2018 20:56:24 +0000 (22:56 +0200)]
Make HTTP header parsing case-insensitive.

2 years agoCapitalize HTTP header names after dashes.
Steinar H. Gunderson [Mon, 9 Apr 2018 18:57:15 +0000 (20:57 +0200)]
Capitalize HTTP header names after dashes.

In particular, writing Content-Length instead of Content-length fixes a
problem where VLC's HTTP client would hang forever on our responses.
This makes HLS generally work in VLC, although it still starts playing
from the start instead of from the end.

2 years agoSend close_notify when closing a kTLS connection; fixes some warnings from GnuTLS.
Steinar H. Gunderson [Mon, 9 Apr 2018 18:28:31 +0000 (20:28 +0200)]
Send close_notify when closing a kTLS connection; fixes some warnings from GnuTLS.

2 years agoTry to fix some overflow issues on 32-bit platforms, where size_t is 32-bit. Untested.
Steinar H. Gunderson [Sat, 7 Apr 2018 10:04:38 +0000 (12:04 +0200)]
Try to fix some overflow issues on 32-bit platforms, where size_t is 32-bit. Untested.

2 years agoFix a GCC warning.
Steinar H. Gunderson [Sat, 7 Apr 2018 09:15:50 +0000 (11:15 +0200)]
Fix a GCC warning.

2 years agoReplace map with unordered_map nearly everywhere, for speed.
Steinar H. Gunderson [Sat, 7 Apr 2018 09:14:51 +0000 (11:14 +0200)]
Replace map with unordered_map nearly everywhere, for speed.

2 years agoWhen doing persistent connections, explicitly flush the socket so that we do not...
Steinar H. Gunderson [Sat, 7 Apr 2018 00:58:10 +0000 (02:58 +0200)]
When doing persistent connections, explicitly flush the socket so that we do not get 200 ms extra delay for the last bytes due to TCP_CORK.

2 years agoAdd support for serving HLS playlists.
Steinar H. Gunderson [Fri, 6 Apr 2018 20:57:14 +0000 (22:57 +0200)]
Add support for serving HLS playlists.

This depends on the new Metacube PTS metadata block, which only
Nageru >= 1.7.2 serves at the moment. Lightly tested with iOS and hls.js;
does not work with VLC and mpv yet.

2 years agoAdd support for deduplicating headers/short responses.
Steinar H. Gunderson [Thu, 5 Apr 2018 18:21:22 +0000 (20:21 +0200)]
Add support for deduplicating headers/short responses.

We don't do any of it right now, but it is relevant when we get HLS
playlists, which we may very well want to share between clients.

2 years agoAdd ?frag=header for getting a HLS fragment of the header only (useful for fMP4).
Steinar H. Gunderson [Wed, 4 Apr 2018 20:46:20 +0000 (22:46 +0200)]
Add ?frag=header for getting a HLS fragment of the header only (useful for fMP4).

2 years agoSupport delivering fragments from the backlog; intended for HLS.
Steinar H. Gunderson [Tue, 3 Apr 2018 22:40:33 +0000 (00:40 +0200)]
Support delivering fragments from the backlog; intended for HLS.

2 years agoSupport HTTP/1.1 persistent connections (not that useful yet).
Steinar H. Gunderson [Tue, 3 Apr 2018 21:29:45 +0000 (23:29 +0200)]
Support HTTP/1.1 persistent connections (not that useful yet).

2 years agoDo not serialize prebuffering_bytes in StreamProto.
Steinar H. Gunderson [Fri, 6 Apr 2018 17:13:21 +0000 (19:13 +0200)]
Do not serialize prebuffering_bytes in StreamProto.

There's no need to do this now that we can't have zombie streams anymore
(to be honest, the reason used to be rather thin already; it probably was
rather unintentional).

2 years agoAutomatically delete streams that are no longer in the configuration file.
Steinar H. Gunderson [Fri, 6 Apr 2018 17:11:03 +0000 (19:11 +0200)]
Automatically delete streams that are no longer in the configuration file.

Earlier, you had to mark this by setting src=delete, or the stream would linger
on in a sort of half-state; this was meant as a protection against configuration
messup. It has shown not to be that easy to mess this up in practice, so remove
it to make cleanup simpler.

2 years agoUse C++11 std::mutex and std::lock_guard instead of our RAII wrapper.
Steinar H. Gunderson [Thu, 5 Apr 2018 15:58:22 +0000 (17:58 +0200)]
Use C++11 std::mutex and std::lock_guard instead of our RAII wrapper.

2 years agoUse in-class initialization for making it harder to forget to set a default.
Steinar H. Gunderson [Thu, 5 Apr 2018 15:48:39 +0000 (17:48 +0200)]
Use in-class initialization for making it harder to forget to set a default.

2 years agoUse nullptr instead of NULL everywhere.
Steinar H. Gunderson [Thu, 5 Apr 2018 07:48:46 +0000 (09:48 +0200)]
Use nullptr instead of NULL everywhere.

2 years agoUse unique_ptr a few places instead of explicit delete.
Steinar H. Gunderson [Thu, 5 Apr 2018 07:47:27 +0000 (09:47 +0200)]
Use unique_ptr a few places instead of explicit delete.

2 years agoUse C++11 right angle brackets.
Steinar H. Gunderson [Thu, 5 Apr 2018 07:41:16 +0000 (09:41 +0200)]
Use C++11 right angle brackets.

2 years agoUse C++11 range-based for loops and auto wherever it makes sense.
Steinar H. Gunderson [Thu, 5 Apr 2018 07:40:42 +0000 (09:40 +0200)]
Use C++11 range-based for loops and auto wherever it makes sense.

2 years agoOpen up for C++11.
Steinar H. Gunderson [Thu, 5 Apr 2018 07:40:07 +0000 (09:40 +0200)]
Open up for C++11.

2 years agoUpdate metacube2.h with the latest version (sync with Nageru).
Steinar H. Gunderson [Wed, 4 Apr 2018 22:49:20 +0000 (00:49 +0200)]
Update metacube2.h with the latest version (sync with Nageru).

Contains a new pts metadata block. We don't actually use it yet.

2 years agoDo some cleanup around EPOLL_CTL_MOD operations.
Steinar H. Gunderson [Wed, 4 Apr 2018 22:43:55 +0000 (00:43 +0200)]
Do some cleanup around EPOLL_CTL_MOD operations.

2 years agoStop leaking TLS contexts.
Steinar H. Gunderson [Tue, 3 Apr 2018 16:25:14 +0000 (18:25 +0200)]
Stop leaking TLS contexts.

2 years agoAdd an example for a TLS port.
Steinar H. Gunderson [Tue, 3 Apr 2018 16:24:00 +0000 (18:24 +0200)]
Add an example for a TLS port.

2 years agoAdd server-side TLS support, through kTLS.
Steinar H. Gunderson [Sun, 1 Apr 2018 19:03:13 +0000 (21:03 +0200)]
Add server-side TLS support, through kTLS.

This, unfortunately, includes a (lightly patched) embedded copy of
the TLS library TLSe in tlse/, since it doesn't really work in any
other way.

2 years agoBump version to 1.4.0-pre.
Steinar H. Gunderson [Sun, 1 Apr 2018 00:44:02 +0000 (02:44 +0200)]
Bump version to 1.4.0-pre.

2 years agoRemove some code for pre-1.1.3 deserialization compatibility.
Steinar H. Gunderson [Sat, 31 Mar 2018 17:22:54 +0000 (19:22 +0200)]
Remove some code for pre-1.1.3 deserialization compatibility.

2 years agoFix a spurious warning during deserialization of UDP streams.
Steinar H. Gunderson [Sat, 31 Mar 2018 10:15:13 +0000 (12:15 +0200)]
Fix a spurious warning during deserialization of UDP streams.

3 years agoRelease Cubemap 1.3.2. 1.3.2
Steinar H. Gunderson [Wed, 24 May 2017 19:28:51 +0000 (21:28 +0200)]
Release Cubemap 1.3.2.

3 years agoFix a problem where streams with paths exactly 7 characters long get broken buffering...
Steinar H. Gunderson [Wed, 24 May 2017 19:24:57 +0000 (21:24 +0200)]
Fix a problem where streams with paths exactly 7 characters long get broken buffering behavior (served from start of backlog).

4 years agoBump version number to 1.3.2-dev.
Steinar H. Gunderson [Fri, 22 Jul 2016 22:45:50 +0000 (00:45 +0200)]
Bump version number to 1.3.2-dev.

4 years agoRelease Cubemap 1.3.1. 1.3.1
Steinar H. Gunderson [Fri, 22 Jul 2016 22:44:24 +0000 (00:44 +0200)]
Release Cubemap 1.3.1.

4 years agoAdd latency statistics to the Munin plugin.
Steinar H. Gunderson [Fri, 22 Jul 2016 22:41:26 +0000 (00:41 +0200)]
Add latency statistics to the Munin plugin.

4 years agoSupport Metacube metadata blocks, specifically timestamps.
Steinar H. Gunderson [Sat, 16 Jul 2016 17:43:29 +0000 (19:43 +0200)]
Support Metacube metadata blocks, specifically timestamps.

Allows you to measure latency from encoder to reflector; specifically,
this is useful to figure out if you have a HTTP queue that keeps on
growing indefinitely.

4 years agoBump version number to 1.3.1-dev.
Steinar H. Gunderson [Wed, 13 Jul 2016 22:50:28 +0000 (00:50 +0200)]
Bump version number to 1.3.1-dev.

4 years agoRelease Cubemap 1.3.0. 1.3.0
Steinar H. Gunderson [Wed, 13 Jul 2016 22:48:52 +0000 (00:48 +0200)]
Release Cubemap 1.3.0.

4 years agoFix verbosity checks on deserialization.
Steinar H. Gunderson [Wed, 13 Jul 2016 18:59:25 +0000 (20:59 +0200)]
Fix verbosity checks on deserialization.

4 years agoAdd some log suppressions I missed last time.
Steinar H. Gunderson [Wed, 13 Jul 2016 18:58:38 +0000 (20:58 +0200)]
Add some log suppressions I missed last time.

4 years agoSuppress HTTP input errors if there are too many of them; reduces log spam a fair...
Steinar H. Gunderson [Wed, 13 Jul 2016 13:51:52 +0000 (15:51 +0200)]
Suppress HTTP input errors if there are too many of them; reduces log spam a fair bit.

4 years agoFix a memory leak with raw inputs.
Steinar H. Gunderson [Fri, 27 May 2016 08:13:26 +0000 (10:13 +0200)]
Fix a memory leak with raw inputs.

4 years agoFix an issue where “http” could sneak into the Host: header.
Steinar H. Gunderson [Fri, 27 May 2016 08:11:19 +0000 (10:11 +0200)]
Fix an issue where “http” could sneak into the Host: header.

4 years agoRemove input encoding for UDP streams.
Steinar H. Gunderson [Tue, 24 May 2016 22:15:40 +0000 (00:15 +0200)]
Remove input encoding for UDP streams.

Metacube input makes no sense for UDP; this was a bit too eager
copy-and-paste. And even worse, it had now become default.

4 years agoFix a typo.
Steinar H. Gunderson [Tue, 24 May 2016 22:10:39 +0000 (00:10 +0200)]
Fix a typo.

4 years agoMake the HTTP client send the right Host: header.
Steinar H. Gunderson [Mon, 9 May 2016 21:26:16 +0000 (23:26 +0200)]
Make the HTTP client send the right Host: header.

4 years agoFix an issue where Metacube output would not include updated headers (e.g. on encoder...
Steinar H. Gunderson [Mon, 18 Apr 2016 22:17:46 +0000 (00:17 +0200)]
Fix an issue where Metacube output would not include updated headers (e.g. on encoder restart).

4 years agoAdd suppor for raw (non-Metacube) inputs over HTTP. Only really useful for TS.
Steinar H. Gunderson [Sat, 9 Apr 2016 23:15:21 +0000 (01:15 +0200)]
Add suppor for raw (non-Metacube) inputs over HTTP. Only really useful for TS.

4 years agoExplicitly specify proto2 syntax to silence a warning.
Steinar H. Gunderson [Sat, 9 Apr 2016 23:15:00 +0000 (01:15 +0200)]
Explicitly specify proto2 syntax to silence a warning.

4 years agoInstall the systemd service without obeying PREFIX.
Philipp Kern [Sat, 2 Apr 2016 13:52:33 +0000 (15:52 +0200)]
Install the systemd service without obeying PREFIX.

4 years agoBump versoin to 1.2.3-dev.
Steinar H. Gunderson [Sun, 3 Apr 2016 23:54:44 +0000 (01:54 +0200)]
Bump versoin to 1.2.3-dev.

4 years agoRelease Cubemap 1.2.2. 1.2.2
Steinar H. Gunderson [Fri, 1 Apr 2016 23:35:42 +0000 (01:35 +0200)]
Release Cubemap 1.2.2.

4 years agoFix an issue where access.log would have the wrong timestamp.
Steinar H. Gunderson [Fri, 1 Apr 2016 23:17:18 +0000 (01:17 +0200)]
Fix an issue where access.log would have the wrong timestamp.

The refactoring to use monotonic timestamps did not take into account
that the timestamps are used for the access log, so it'd contain
(roughly) time since boot instead of the actual time of day. Fixed by
measuring the offset between the two (although if the clock is wrong
at the time of logging, the connection time will be wrong -- as opposed
to if the clock is wrong at the time of connect, hard to say which is
the better). Reported by Joachim Tingvold.

While we are at it, change some of the timespec functions so that we
get slightly more precise timing in the logs (it could be about a second
off). For cosmetics only.

4 years agoFix HTTP connections to IPv6 address literals.
Steinar H. Gunderson [Mon, 28 Mar 2016 22:36:57 +0000 (00:36 +0200)]
Fix HTTP connections to IPv6 address literals.

4 years agoUp the Metacube block limit yet again; MP4 can create huge clusters.
Steinar H. Gunderson [Mon, 28 Mar 2016 22:35:39 +0000 (00:35 +0200)]
Up the Metacube block limit yet again; MP4 can create huge clusters.

4 years agoAdd a missing compilation step to the README.
Steinar H. Gunderson [Mon, 28 Mar 2016 22:35:08 +0000 (00:35 +0200)]
Add a missing compilation step to the README.

4 years agoUpdate email address.
Steinar H. Gunderson [Wed, 17 Feb 2016 19:42:17 +0000 (20:42 +0100)]
Update email address.

5 years agoAdd a configure script, for easier override of CXXFLAGS etc.
Steinar H. Gunderson [Thu, 3 Sep 2015 19:14:41 +0000 (21:14 +0200)]
Add a configure script, for easier override of CXXFLAGS etc.

5 years agoAdd missing libsystemd-dev package to HOWTO.
Steinar H. Gunderson [Thu, 3 Sep 2015 19:12:05 +0000 (21:12 +0200)]
Add missing libsystemd-dev package to HOWTO.

5 years agoBump version number to 1.2.2-pre.
Steinar H. Gunderson [Sun, 30 Aug 2015 11:18:24 +0000 (13:18 +0200)]
Bump version number to 1.2.2-pre.

5 years agoRelease Cubemap 1.2.1. 1.2.1
Steinar H. Gunderson [Sun, 30 Aug 2015 11:16:48 +0000 (13:16 +0200)]
Release Cubemap 1.2.1.

5 years agoRename ping to gen204, and change the response type to a 204 No Response, since that...
Steinar H. Gunderson [Sun, 16 Aug 2015 11:26:20 +0000 (13:26 +0200)]
Rename ping to gen204, and change the response type to a 204 No Response, since that is a bit more appropriate than a dummy one.

5 years agoAdd a simple HTTP endpoint that returns a very short string.
Steinar H. Gunderson [Sat, 15 Aug 2015 22:50:05 +0000 (00:50 +0200)]
Add a simple HTTP endpoint that returns a very short string.

The intention is for clients to be able to probe the endpoint
to figure out which server is the fastest. To this end,
it supports CORS headers so that XHR is allowed to differentiate
servers that are down from servers that respond properly.

5 years agoRename header_or_error to header_or_short_response, as it will soon be able to contai...
Steinar H. Gunderson [Sat, 15 Aug 2015 22:27:33 +0000 (00:27 +0200)]
Rename header_or_error to header_or_short_response, as it will soon be able to contain pongs.

Similarly, rename the state from SENDING_ERROR to SENDING_SHORT_RESPONSE.

5 years agoUse libsystemd to inform systemd accurately about when the service is up and running.
Steinar H. Gunderson [Mon, 10 Aug 2015 22:13:39 +0000 (00:13 +0200)]
Use libsystemd to inform systemd accurately about when the service is up and running.

5 years agoRemove std:: from all code in .cpp files, for consistency.
Steinar H. Gunderson [Fri, 7 Aug 2015 22:20:00 +0000 (00:20 +0200)]
Remove std:: from all code in .cpp files, for consistency.

5 years agoAdd a missing const.
Steinar H. Gunderson [Fri, 7 Aug 2015 22:16:47 +0000 (00:16 +0200)]
Add a missing const.

5 years agoBetter documentation of config options in cubemap.config.sample.
Steinar H. Gunderson [Fri, 7 Aug 2015 20:54:50 +0000 (22:54 +0200)]
Better documentation of config options in cubemap.config.sample.

There were too many options that were basically undocumented by now;
add some hopefully helpful comments.

5 years agoBump version number to 1.2.1-pre.
Steinar H. Gunderson [Fri, 24 Jul 2015 16:11:33 +0000 (18:11 +0200)]
Bump version number to 1.2.1-pre.

5 years agoRelease Cubemap 1.2.0. 1.2.0
Steinar H. Gunderson [Fri, 24 Jul 2015 16:10:43 +0000 (18:10 +0200)]
Release Cubemap 1.2.0.

5 years agoMinor grammatical fix.
Steinar H. Gunderson [Thu, 23 Jul 2015 20:50:10 +0000 (22:50 +0200)]
Minor grammatical fix.

5 years agoUse CLOCK_MONOTONIC for serialization time as well.
Steinar H. Gunderson [Thu, 23 Jul 2015 20:21:25 +0000 (22:21 +0200)]
Use CLOCK_MONOTONIC for serialization time as well.

This removes the last use of non-monotonic timers, even if it's
only for logging information.

Don't use COARSE, since we have no idea how coarse that is
and we want millisecond-level precision. But we don't really
care about the nanoseconds.

5 years agoUse CLOCK_MONOTONIC_COARSE in httpinput.cpp; we do not need precise timing here.
Steinar H. Gunderson [Thu, 23 Jul 2015 20:18:37 +0000 (22:18 +0200)]
Use CLOCK_MONOTONIC_COARSE in httpinput.cpp; we do not need precise timing here.

5 years agoAllow prebuffer to happen by playing data from the backlog.
Steinar H. Gunderson [Thu, 23 Jul 2015 16:31:06 +0000 (18:31 +0200)]
Allow prebuffer to happen by playing data from the backlog.

This won't reduce the latency (although it shouldn't increase it either, unless
you have extreme bitrate changes), but it should give a picture on screen much
sooner, hopefully getting rid of the “what's going on, why is nothing starting”
feeling.

5 years agoMake the SENDING_HEADER state fall through.
Steinar H. Gunderson [Thu, 23 Jul 2015 16:23:48 +0000 (18:23 +0200)]
Make the SENDING_HEADER state fall through.

In the case where we really are in WAITING_KEYFRAME, we will go to
sleep immediately in the state below, but there's also a case
where we could end up directly in SENDING_DATA and don't want to
wait for the stream to get more data to start sending.

5 years agoAdd a helper variable.
Steinar H. Gunderson [Thu, 23 Jul 2015 16:22:03 +0000 (18:22 +0200)]
Add a helper variable.

5 years agoRemove an obsolete comment.
Steinar H. Gunderson [Thu, 23 Jul 2015 16:21:07 +0000 (18:21 +0200)]
Remove an obsolete comment.

5 years agoReset the list of suitable starting points when changing header.
Steinar H. Gunderson [Thu, 23 Jul 2015 15:54:19 +0000 (17:54 +0200)]
Reset the list of suitable starting points when changing header.

5 years agoStore multiple suitable starting points for each stream.
Steinar H. Gunderson [Thu, 23 Jul 2015 15:48:06 +0000 (17:48 +0200)]
Store multiple suitable starting points for each stream.

We still only use the last one. This will change soon.

5 years agoPartially revert last patch.
Steinar H. Gunderson [Thu, 23 Jul 2015 15:29:13 +0000 (17:29 +0200)]
Partially revert last patch.

add_data_raw() does not change the stream suitability points at all;
it just writes to disk. Thus, we don't need this complicated little dance
to give it multiple blocks.

5 years agoTrack stream start suitability separately for each data block added.
Steinar H. Gunderson [Thu, 23 Jul 2015 10:22:35 +0000 (12:22 +0200)]
Track stream start suitability separately for each data block added.

When having queued data, keep the separate stream start suitability flag
for each iovec instead of just storing the index of the last block.
This is a no-op in itself, but it is a prerequisite for tracking it in
the backlog as well, which we want to do to be able to have force_prebuffer
give out older data -- that requires tracking not only the last suitable
starting point, but multiple ones backwards in time.

Also add a TODO to update starting point(s) when the header changes.

5 years agoRename queued_data_last_starting_point to queued_data_last_starting_point_index,...
Steinar H. Gunderson [Wed, 22 Jul 2015 22:53:29 +0000 (00:53 +0200)]
Rename queued_data_last_starting_point to queued_data_last_starting_point_index, since otherwise it sounds like a number of bytes.

5 years agoMake the warning on dropping junk bytes clearer.
Steinar H. Gunderson [Wed, 22 Jul 2015 22:48:23 +0000 (00:48 +0200)]
Make the warning on dropping junk bytes clearer.

5 years agoAdd missing postcondition comment.
Steinar H. Gunderson [Wed, 22 Jul 2015 22:47:23 +0000 (00:47 +0200)]
Add missing postcondition comment.

5 years agoRespect prebuffering_bytes= on existing streams when reloading.
Steinar H. Gunderson [Wed, 22 Jul 2015 22:01:39 +0000 (00:01 +0200)]
Respect prebuffering_bytes= on existing streams when reloading.

5 years agoParse and log referer and user-agent headers in requests.
Steinar H. Gunderson [Wed, 22 Jul 2015 13:05:14 +0000 (15:05 +0200)]
Parse and log referer and user-agent headers in requests.

5 years agoTabs are seemingly accepted as linear white space in HTTP headers.
Steinar H. Gunderson [Wed, 22 Jul 2015 09:48:30 +0000 (11:48 +0200)]
Tabs are seemingly accepted as linear white space in HTTP headers.

5 years agoSplit HTTP header parsing into a common function.
Steinar H. Gunderson [Wed, 22 Jul 2015 09:46:42 +0000 (11:46 +0200)]
Split HTTP header parsing into a common function.

5 years agoMake a comment more precise.
Steinar H. Gunderson [Wed, 22 Jul 2015 00:27:06 +0000 (02:27 +0200)]
Make a comment more precise.

5 years agoReplace an assert with a small hack.
Steinar H. Gunderson [Wed, 22 Jul 2015 00:12:37 +0000 (02:12 +0200)]
Replace an assert with a small hack.

Instead of checking that connect times are monotonic, explicitly make them
so if they're not. This seems safest, in case the monotonic clock goes
backwards a small bit (e.g. when changing CPUs). We don't need it for the
serialized case since we explicitly sort those by time; the assert can stay.

5 years agoTime out clients still in READING_REQUEST after 60 seconds.
Steinar H. Gunderson [Tue, 21 Jul 2015 23:57:04 +0000 (01:57 +0200)]
Time out clients still in READING_REQUEST after 60 seconds.

Seemingly there are some of these around, and I've seen them eat up
fds in a long-running server. There's some pain in sorting the clients
on deserialization, but apart from that, this ended up being relatively
pain-free and should be efficient enough.

5 years agoChange the connected time from time_t to timespec.
Steinar H. Gunderson [Tue, 21 Jul 2015 23:08:00 +0000 (01:08 +0200)]
Change the connected time from time_t to timespec.

The primary gain as the code stands is that we become immune to
issues with the clock going backwards etc. in logs (since we can
now use a monotonic timer).

However, the motivating change is that we will soon be implementing request
read timeouts. At that point, not only will the clock data be much more
important to get right, but it will also be nice to have more fine-grained
timestamps to be able to locate clients semi-uniquely in a sorted list.

5 years agoMerge branch 'master' of /srv/git.sesse.net/www/cubemap
Steinar H. Gunderson [Fri, 10 Jul 2015 21:46:37 +0000 (23:46 +0200)]
Merge branch 'master' of /srv/git.sesse.net/www/cubemap

5 years agoAdd support for forced prebuffering.
Steinar H. Gunderson [Fri, 10 Jul 2015 21:29:42 +0000 (23:29 +0200)]
Add support for forced prebuffering.

The motivation is jwPlayer, which for HTTP files expects to be able
to do no prebuffering and just download full speed nevertheless
(as it assumes they are static files, not streams) -- when it cannot,
it shows an ugly icon on top of the stream all the time. So we add
an option for forced prebuffering (three seconds seems to be about
fine) which means we wait sending until we have a pretty big backlog.

Ideally, we would be able to actually send old data instead of just
waiting (which would mean that the client doesn't need the extra wait
at the beginning), but it's complicated with having to remember old
keyframe positions, changed stream headers etc.

5 years agoBeef up the warning limit for large blocks a bit; MKV chunks can get pretty big.
Steinar H. Gunderson [Fri, 10 Jul 2015 21:01:50 +0000 (23:01 +0200)]
Beef up the warning limit for large blocks a bit; MKV chunks can get pretty big.