Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Jan 30, 2024
1 parent 09fcc51 commit e50e410
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 0 additions & 4 deletions internal/reliabletransport/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,4 @@
// of why this is needed, and how it relates to the requirements of the control channel.
// It is worth to mention that, even though the original need is to have a reliable control channel
// on top of UDP, this is also used when tunneling over TCP.
//
// A note about terminology: in this package, "receiver" is the moveUpWorker in the [reliabletransport.Service] (since it receives incoming packets), and
// "sender" is the moveDownWorker in the same service. The corresponding data structures lack mutexes because they are intended to be confined to a single
// goroutine (one for each worker), and they SHOULD ONLY communicate via message passing.
package reliabletransport
5 changes: 4 additions & 1 deletion internal/reliabletransport/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import (
"github.com/ooni/minivpn/internal/optional"
)

// moveUpWorker moves packets up the stack (receiver)
// moveUpWorker moves packets up the stack (receiver).
// The sender and receiver data structures lack mutexs because they are
// intended to be confined to a single goroutine (one for each worker), and
// they SHOULD ONLY communicate via message passing.
func (ws *workersState) moveUpWorker() {
workerName := fmt.Sprintf("%s: moveUpWorker", serviceName)

Expand Down
4 changes: 3 additions & 1 deletion internal/reliabletransport/sender.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import (
)

// moveDownWorker moves packets down the stack (sender)
// TODO move the worker to sender.go
// The sender and receiver data structures lack mutexes because they are
// intended to be confined to a single goroutine (one for each worker), and
// they SHOULD ONLY communicate via message passing.
func (ws *workersState) moveDownWorker() {
workerName := fmt.Sprintf("%s: moveDownWorker", serviceName)

Expand Down
5 changes: 3 additions & 2 deletions internal/reliabletransport/service.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Package reliabletransport implements the reliable transport.
package reliabletransport

import (
Expand Down Expand Up @@ -37,7 +36,9 @@ func (s *Service) StartWorkers(
sessionManager *session.Manager,
) {
ws := &workersState{
logger: logger,
logger: logger,
// incomingSeen is a buffered channel to avoid losing packets if we're busy
// processing in the sender goroutine.
incomingSeen: make(chan incomingPacketSeen, 20),
dataOrControlToMuxer: *s.DataOrControlToMuxer,
controlToReliable: s.ControlToReliable,
Expand Down

0 comments on commit e50e410

Please sign in to comment.