Commit graph

76 commits

Author SHA1 Message Date
Oliver Jowett 70e8579850 Simple filter for spurious messages that make it past checksum:
don't show aircraft until we have seen 2 messages from them.
2015-01-22 13:22:16 +00:00
Oliver Jowett ada188a1c8 Changed my mind, put the non-ICAO flag bit in the address itself
since we have 8 bits spare, so there's no chance of confusing it
with an ICAO address, and we can safely use the filter table to match
future messages without also matching equivalent ICAO addresses.
2015-01-22 12:30:12 +00:00
Oliver Jowett 35551b4455 Don't emit FATSV output for non-ICAO addresses. 2015-01-22 12:18:46 +00:00
Oliver Jowett 6e1315e3a6 Flag non-ICAO addresses in json output. 2015-01-22 12:18:14 +00:00
Oliver Jowett d0605629b6 Avoid zero signalLevel. 2015-01-22 11:40:52 +00:00
Oliver Jowett 7850848ef7 Export a few stats via JSON. 2015-01-22 01:21:53 +00:00
Oliver Jowett 19082d92ea Measure signal power / noise power (at least in 2.4MHz mode).
Switch signalLevel back to a power measurement, don't put SNR in there.
But make it a 0.0 - 1.0 double so we're not scaling everywhere.

Adjust for the amplitude offset when calculating power.

Adapt everything else to the new scheme.
2015-01-22 01:01:39 +00:00
Oliver Jowett 2a1a2a0a71 Fix (maybe) JSON escaping.
I've obviously never tested this code!
2015-01-21 11:58:51 +00:00
Oliver Jowett cae20a8060 Escape flight name in JSON in case it has odd characters. 2015-01-21 11:56:27 +00:00
Oliver Jowett ebae590653 Use MODES_NOTUSED for unused args. 2015-01-21 11:54:55 +00:00
Oliver Jowett 5e522fe8db Decoder cleanups from experimental branch. 2015-01-21 00:23:48 +00:00
Oliver Jowett b9b76da02d Stats rearrangement, based on experimental branch changes. 2015-01-20 17:16:35 +00:00
Oliver Jowett e02a2cdd44 GPL. 2015-01-20 16:49:01 +00:00
Oliver Jowett e68949bdb3 Write an accurate value for the history count, so the progress bar is correct.
(cherry picked from commit 0919700293e34f5a93a4407d33e1e56c0ae0d13c)
2015-01-16 20:33:40 +00:00
Oliver Jowett c7204ec6ab Support image/gif content type
(cherry picked from commit f4b38a62f69d0df2bb5d3a87979e38d76249b80a)
2015-01-16 20:33:08 +00:00
Oliver Jowett 1db63ebc65 Add generation of history JSON.
Add support for URL handlers that match a path prefix.

(cherry picked from commit 38faa510cb881cbf9d2a0a85bbde61130b5259e7)
2015-01-16 20:31:59 +00:00
Oliver Jowett b1bfb4d520 Rationalization of JSON output. Pass actual URL path to URL handler.
(cherry picked from commit becce8d69a6e6cee38d4fdb78b5a4e25d570baea)
2015-01-16 20:30:41 +00:00
Oliver Jowett 63fb121d1c Status messages in HTTP responses.
(cherry picked from commit 820528b4ad7f3963199718205724cdf3ac97b113)
2015-01-16 20:28:36 +00:00
Oliver Jowett 72bfc31458 Display message rate (30 sec average) on the webmap.
(cherry picked from commit 848af78be685c6e2a26d0b30e9f385696201a2c4)
2015-01-13 22:01:53 +00:00
Oliver Jowett 0976d12b88 Ditch any query strings in HTTP requests before handling them,
to allow AJAX requests to tack on a query string to avoid caching.
2015-01-07 18:40:55 +00:00
Oliver Jowett e8a62293c2 More WIP on the webmap, mostly fixing up track history. 2015-01-06 01:00:44 +00:00
Oliver Jowett 1f06abf67d WIP webmap cleanup 2015-01-05 23:20:03 +00:00
Oliver Jowett 58dfbdcb6b Add support for controlling the accuracy of the receiver location
written in the JSON metadata used by the webmap.
2014-12-27 20:52:56 +00:00
Oliver Jowett 9fa09e0e92 receiver.json support, internal webserver cleanup.
Add data/receiver.json (generated once) and support for it in script.js.

Internal webserver rearrangement to support multiple json files.
2014-12-10 17:05:22 +00:00
Oliver Jowett c712543ee5 Only completeWrite() if we didn't run off the end of the buffer.
If we did run off the end, complain about it.
2014-12-08 20:17:48 +00:00
Oliver Jowett 39d905324f Be more paranoid about not overrunning our fatsv output buffer.
Request a buffer of a more reasonable size.
2014-12-08 20:14:53 +00:00
Oliver Jowett 2dcc8e3524 Add direct support for FATSV-format output.
This is adapted from the FlightAware fork, with some cleanup and
modifications needed to work with the net-cleanup changes.

Inclusion of "verbatim" TSV data read from an AVR-format input
connection is not supported.
2014-12-08 19:56:45 +00:00
Oliver Jowett af957da81c Merge branch 'realpath-memory-leak' 2014-12-07 14:10:17 +00:00
Oliver Jowett d09eefb827 Fix a memory leak from use of realpath() in HTTP request processing.
realpath() returns a heap-allocated buffer if given NULL for the destination buffer.
This must be freed by the caller; dump1090 does not do this.

Instead of worrying about freeing it, take the simpler approach of just providing a
stack-allocated destination buffer.
2014-12-07 14:05:24 +00:00
Oliver Jowett e0bc89e542 Merge branch 'write-json-files' into oversampling 2014-11-23 16:34:18 +00:00
Oliver Jowett ebab2c0e11 Create json files with mode 0644 - umask.
mkstemp defaults to 0600 which is not so useful for serving the file.
2014-11-23 16:32:45 +00:00
Oliver Jowett 7bd2ee5510 Merge branch 'write-json-files' into oversampling
Conflicts:
	dump1090.c
	dump1090.h
2014-11-23 16:03:35 +00:00
Oliver Jowett 6910a4bf4d Experimental json changes 2014-11-23 16:02:11 +00:00
Oliver Jowett 29d1e53f9f Merge remote-tracking branch 'upstream/master' into net-cleanups 2014-10-31 17:58:03 +00:00
Malcolm Robb 5f18f6cbca Fix warnings and Windows compile problems 2014-10-29 19:00:42 +00:00
MalcolmRobb 5699e48855 Merge pull request #54 from l0calguest/bind_address
Ability to assign bind address for services
2014-10-29 17:21:12 +00:00
hhm 027ab92e7a Merge branch 'master' of https://www.github.com/MalcolmRobb/dump1090 into http_server_wk 2014-10-29 10:29:04 -04:00
demonx 5b4d811c7d Ability to assign bind address for services 2014-10-25 21:33:45 +02:00
hhm f71bc6c130 Merge branch 'master' of https://www.github.com/MalcolmRobb/dump1090 into http_server_wk 2014-10-04 21:39:15 -04:00
hhm e20e240130 B"H Merge branch 'master' of https://www.github.com/MalcolmRobb/dump1090 into socket_hang
Conflicts:
	net_io.c
2014-10-04 21:36:51 -04:00
Oliver Jowett 1769ac9006 Restructuring of network output side.
Mostly refactoring the common code that was duplicated
between the different output types so that there aren't
many copies floating around.

This introduces "struct net_writer" to store the state of a
particular type of output service - buffers, time of last write,
connection count etc. prepareWrite() / completeWrite() give access
to the buffer and handle the actual writes and flushing when needed.

Heartbeat and time-based flushing move into a generic periodic-work
function.

Update the SBS output code to use the new infrastructure. This makes
a big different to CPU use when under load.
2014-10-03 22:55:21 +01:00
Oliver Jowett 8d4f1a396c Merge branch 'fix-net-list-corruption' into net-cleanups 2014-10-03 20:58:52 +01:00
MalcolmRobb 65751ed6e9 Merge pull request #45 from mutability/net-client-eof-handling
Detect client EOF properly. Handle EWOULDBLOCK.
2014-10-02 21:32:40 +01:00
Oliver Jowett a2f49f2bb8 Fix a crash when an outbound client is closed in response to reading a remote message.
When we read from some client A, we may end up forwarding a message to other
clients. If we forward to some client B and there is a write error, then
we close B and remove it from the client list. However, if before this happened
A->next == B, then the read loop will still be holding on to a pointer to B,
and we crash.

As it's unpredictable what clients could be closed at what point, the simplest
approach is to retain closed clients in the list until we are at a point where
we know there are no stray pointers on stack, and only then modify the list.
This also simplifies anything that has to loop over clients, as it doesn't need
to worry about the current client being freed under it.
2014-10-02 21:06:10 +01:00
Malcolm Robb 5a5c52d7a9 Merge remote-tracking branch 'origin/pr/46' 2014-10-02 19:53:43 +01:00
Oliver Jowett 15f3408d8e Always emit a message reception time, as otherwise the FR24 uploader is unhappy.
When we don't have a time available (e.g. remote message) use the system time.
2014-10-02 12:20:37 +01:00
hhm 13fe375437 Merge branch 'master' of https://www.github.com/MalcolmRobb/dump1090 into http_server_wk 2014-10-01 11:10:41 -04:00
hhm 8b4d5b3dca Merge branch 'master' of https://www.github.com/MalcolmRobb/dump1090 into socket_hang 2014-10-01 11:10:19 -04:00
Oliver Jowett 186cac5c25 Use the anet-reported error string when reporting bind errors.
errno may have been modified by the time you see it.
2014-10-01 12:37:29 +01:00
Oliver Jowett a513c3677b Detect client EOF properly. Handle EWOULDBLOCK.
Client disconnection appears as a read of 0 bytes.
Without a test for this, dump1090 continues to poll that client forever.

Also, read() may return EWOULDBLOCK as well as EAGAIN
for "no data right now", so handle that.

I don't know if there is an equivalent Win32 bug here as the Win32
interfaces seem subtly different to vanilla POSIX.

The following test/break can probably be removed if Win32 needs
the same fix.
2014-10-01 12:29:16 +01:00