Skip to content

Commit

Permalink
Fix missing error return checks and comment typos
Browse files Browse the repository at this point in the history
  • Loading branch information
rod-hynes committed Jul 5, 2024
1 parent f5d3b96 commit 4d52662
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions psiphon/common/inproxy/broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,9 @@ func (b *Broker) HandleSessionPacket(
handleUnwrappedRequest := func(initiatorID ID, unwrappedRequestPayload []byte) ([]byte, error) {

recordType, err := peekRecordPreambleType(unwrappedRequestPayload)
if err != nil {
return nil, errors.Trace(err)
}

var responsePayload []byte

Expand Down
7 changes: 5 additions & 2 deletions psiphon/common/inproxy/webrtc.go
Original file line number Diff line number Diff line change
Expand Up @@ -1620,7 +1620,10 @@ func processSDPAddresses(
if err != nil {
return nil, nil, errors.Trace(err)
}
port, _ := strconv.Atoi(portStr)
port, err := strconv.Atoi(portStr)
if err != nil {
return nil, nil, errors.Trace(err)
}

// Only IPv4 port mapping addresses are supported due to the
// NewCandidateHost limitation noted below. It is expected that port
Expand Down Expand Up @@ -1735,7 +1738,7 @@ func processSDPAddresses(
// network addresses misuse non-private IP ranges (so are
// technically not bogons). Instead of outright rejecting
// SDPs containing unexpected GeoIP candidates, they are
// instead stripped out and the the resulting filtered SDP is
// instead stripped out and the resulting filtered SDP is
// used.

if lookupGeoIP != nil {
Expand Down
2 changes: 1 addition & 1 deletion psiphon/meekConn.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ type MeekConfig struct {
// HTTP level; TLS and server certificate verification is required; the
// origin server may be any HTTP(S) server.
//
// MeekModeWrappedPlaintextRoundTrip: is equivilent to
// MeekModeWrappedPlaintextRoundTrip: is equivalent to
// MeekModePlaintextRoundTrip, except skipping of server certificate
// verification is permitted. In this mode, the caller is asserting that
// the HTTP plaintext payload is wrapped in its own transport security
Expand Down

0 comments on commit 4d52662

Please sign in to comment.