Commit Graph

11 Commits

Author SHA1 Message Date
Sarah Jamie Lewis 6f9718596d fmt and travis update 2018-05-09 12:40:07 -07:00
Sarah Jamie Lewis 9980da3bd5 Fixing channelmanager race condition, deleting vendoring 2018-05-09 12:06:34 -07:00
Dan Ballard 3920d33a77 add util to get onion address from private key (#39)
* add util to get onion address from private key

* PR comments: added test, using go-ricochet errors, function argument a privateKey

* remove unnecesary cast and variable
2018-04-30 18:03:06 -07:00
Sarah Jamie Lewis a04b3fe08b Moving ChannelResult processing to ControlChannel file and testing 2018-01-14 11:50:15 -05:00
John Brooks e459a56286 Prevent deadlocks with Do or Break and closing connections
After the last round of fixes in Do, there was still one major issue
making it impossible to use Do or Break safely: closing connections.

Connections can be closed spontaneously, and this causes Process to
return. At that moment any ongoing call to Do or Break has deadlocked;
nothing will ever read those channels again. To prevent this, we have to
ensure that Do or Break won't try to send to Process' channels once it
has stopped reading from them. Doing that without other races is tricky.

The solution here, briefly, is to acquire a mutex in Do and Break before
checking the `closed` boolean, and hold that mutex for the entire
operation (including any blocking channel operations). When Process is
closing down the connection, it uses a separate goroutine to acquire the
same mutex and change the boolean, while still handling channel reads.
Once the boolean has changed, the mutex guarantees that nothing will try
to send to these channels again.

I've tried to document the problems and solutions in the code, because
it is subtle in some places and this is definitely critical code.
2017-11-02 15:41:34 -07:00
Sarah Jamie Lewis 22cbf5d738 First Cut of Applications + Bugs, Formatting 2017-07-04 11:29:11 -07:00
Sarah Jamie Lewis 1cf7c2b7c7 Adding a Trace log to Connection and removing all other logging directives 2017-06-27 12:48:35 -07:00
Sarah Jamie Lewis f4ed1c244b Adding Inbound Version Negotiation
+ Error handling for missing private key setting
2017-06-27 10:39:33 -07:00
Sarah Jamie Lewis 5d767174b1 Brand new API v0.2 2017-05-02 16:33:51 -07:00
Sarah Jamie Lewis 9d6592e1e4 Fixing up some comments 2016-11-08 15:05:05 -08:00
Sarah Jamie Lewis bfe5b74364 Refactor GoRicochet
* New Service Interface
* Server functionality
* 90% Code Coverage
* Regression Testing of Protocol Compliance
2016-07-02 18:52:28 -07:00