Alvaro Saurin
f6ffd604dd
Removed all the imports from "code.google.com"
2015-07-02 13:32:52 +02:00
Bryan Boreham
013380c7e7
Update router code to use common logger
2015-07-01 12:26:23 +01:00
David Wragg
3222478449
Remove the LogFrame when fragmenting
...
Subsequent commits make this LogFrame call a little tricky to retain,
and it's not clear that it is really needed.
2015-06-29 10:47:26 +01:00
Matthias Radestock
039a2030db
refactor: make DF flag passing logic more obvious
...
...and provide a better abstraction for sending special frames.
2015-06-26 11:11:17 +01:00
David Wragg
64ac7745fe
Don't inspect the DF flag earlier than we need to
2015-06-25 17:11:52 +01:00
David Wragg
4162dcafd3
Make the full EthernetDecoder available to LogFrame
...
So that LogFrame can include information about the decoded frame beyond
the ethernet layer.
2015-06-25 17:11:20 +01:00
David Wragg
7387caa2eb
Eliminate forwarder Start methods
2015-06-24 17:37:07 +01:00
Paul Bellamy
06101d134b
Running goimports
2015-06-17 15:32:08 +01:00
Matthias Radestock
b365c3806b
replace random nonces with message sequence numbers in udp crypto
2015-04-30 14:47:16 +01:00
Matthias Radestock
02a7875eb8
refactor: remove last dependency of crypto on LocalConnection
2015-04-27 07:27:31 +01:00
Matthias Radestock
ea4e84cdd3
refactor: (almost) remove dependency of crypto on LocalConnection
2015-04-27 07:14:30 +01:00
Matthias Radestock
29c02d2724
refactor: lift error handling out of Encryptor.Bytes()
...
in order to reduce dependency on LocalConnection
2015-04-27 07:12:21 +01:00
David Wragg
dceef04ffa
Separate Forwarder and ForwarderDF
...
Much of the state and code associated with Forwarder only applied in the
DF case.
2015-04-18 10:38:05 +01:00
Matthias Radestock
d708cb7d4e
prevent PMTUVerfied handling from blocking
...
...due to blocking on sending the pmtu to the forwarder, because the
forwarder has terminated.
Fixes #464 .
2015-03-29 14:04:28 +01:00
Matthias Radestock
fc22f9664e
refactor: improve encapsulation of Forwarder
2015-03-29 12:14:32 +01:00
Matthias Radestock
4eda7e361b
put back forwarder channel nil check
...
since otherwise forward(...) can block indefinitely due to both the
forwarder channel and finshed channel being nil
2015-03-29 10:36:01 +01:00
Matthias Radestock
b6448fa196
more idiomatic closing of forwarders, by closing a 'finished' channel
...
The previous scheme set the reference to main channel to nil and then
drained it. That was racy and hence could lead to deadlock in the
following scenario:
1. multiple senders obtain the main channel from the stored reference
2. main channel reference is set to nil
3. main channel is drained
4. multiple senders send to main channel
So the issue here is that the entire forwarder stopping sequence
occurs between senders obtaining of the reference to the main channel,
and then sending on that channel. If more senders sent than there is
capacity in the channel then this leads to deadlock.
2015-03-28 20:58:42 +00:00
David Wragg
bc45a363dd
Make Encryptor.AppendFrame more consistent with FrameConsumer
...
Also removes references to Peer type in crypto.go, to keep it agnostic
of higher-level concerns.
2015-03-27 18:05:00 +00:00
Matthias Radestock
4d8c156915
continuing accumulation after dropping a frame is bad after all
...
explain why
2015-03-27 11:56:38 +00:00
Matthias Radestock
6ea625f85b
fix typo
2015-03-27 11:54:24 +00:00
Matthias Radestock
84a95f2daf
refactor: concentrate frame appending code in one place
2015-03-27 11:53:56 +00:00
Matthias Radestock
f544fc68de
enter frame accumulation even after dropping one
...
This logically makes more sense, i.e. we keep draining frames from
fwd.ch until we run out.
2015-03-27 11:35:42 +00:00
Matthias Radestock
83724a08c9
refactor: get rid of Forwarder.stop channel
...
signal termination by sending nil to the main channel instead
2015-03-27 11:32:50 +00:00
Matthias Radestock
157afa0b5d
comment
2015-03-27 11:15:25 +00:00
Matthias Radestock
1a39cb163a
keep accumulating frames even when dropping some
...
This logically makes more sense, i.e. we keep draining frames from
fwd.ch until we run out.
2015-03-27 11:05:50 +00:00
Matthias Radestock
1c5fee0a5e
refactor: simplify Forwarder.run by extracing a helper function
...
Also, don't check for failed receive on fwd.ch; it cannot happen and
we weren't doing it everywhere anyway.
2015-03-27 11:03:05 +00:00
Matthias Radestock
e3ef5433cf
cosmetic: linting
2015-03-27 00:43:26 +00:00
Matthias Radestock
6f89ead9bd
log all connection lifecycle events on local peer
...
There were situations, such as deleting another connection as result
of it losing a tie-break, where lifecycle events of connections on the
local peer weren't logged.
Fixing that entails moving the logging closer to (i.e. right after)
the state change action. This in turn requires promotion of logging to
the Connection interface instead of it LocalConnection. Which in turn
requires a change from 'log' to 'Log', for consistency with other
interface methods.
Fixes #449 .
2015-03-10 14:42:18 +00:00
Matthias Radestock
9c3d509b10
cosmetics
...
suggested by linter
2015-02-03 14:46:35 +00:00
Matthias Radestock
99525ebf85
refactor: LocalConnection.CheckFatal be gone!
...
use Shutdown instead, which is in the Connection interface, thus
further reducing dependency on LocalConnection.
2015-01-21 21:23:59 +00:00
Matthias Radestock
e82ed423c1
cosmetic: move ForwardedFrame type from types.go to forwarder.go
2015-01-20 21:15:50 +00:00
Matthias Radestock
62da72e26d
cosmetic: move a bunch of error types to where they belong
2015-01-20 21:01:50 +00:00
Matthias Radestock
a649d45085
cosmetic: move Forwarder type from types.go to forwarder.go
2015-01-20 20:41:13 +00:00
Matthias Radestock
48c8f9ea01
refactor: separate object creation from activation
2015-01-19 13:23:25 +00:00
Matthias Radestock
3765d23825
refactor: move udp sender code into separate file
2015-01-14 17:51:01 +00:00
Matthias Radestock
58efafd44e
add explanation for why we don't use async send
2014-11-12 08:26:44 +00:00
Matthias Radestock
a587fef9c4
fix package name following move
2014-10-15 15:20:49 +01:00
Matthias Radestock
e2fd1fda31
move router code
2014-10-15 15:07:42 +01:00