Skip to content

Commit

Permalink
martian: remove nosigpipe
Browse files Browse the repository at this point in the history
Removing it as it's not used.
nosigpipe targets only darwin && go1.9, and it's for mobile i.e. running martian on iPhone.
The associated issues are mostly closed, and from 2016/2017.
  • Loading branch information
mmatczuk committed Feb 13, 2024
1 parent 27ef36f commit ad48766
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 56 deletions.
11 changes: 0 additions & 11 deletions internal/martian/nosigpipe/nosigpipe.go

This file was deleted.

38 changes: 0 additions & 38 deletions internal/martian/nosigpipe/nosigpipe_darwin.go

This file was deleted.

8 changes: 1 addition & 7 deletions internal/martian/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (

"github.com/saucelabs/forwarder/internal/martian/log"
"github.com/saucelabs/forwarder/internal/martian/mitm"
"github.com/saucelabs/forwarder/internal/martian/nosigpipe"
"github.com/saucelabs/forwarder/internal/martian/proxyutil"
"golang.org/x/net/http/httpguts"
)
Expand Down Expand Up @@ -172,11 +171,7 @@ func (p *Proxy) SetUpstreamProxyFunc(f func(*http.Request) (*url.URL, error)) {

// SetDialContext sets the dial func used to establish a connection.
func (p *Proxy) SetDialContext(dial func(context.Context, string, string) (net.Conn, error)) {
p.dial = func(ctx context.Context, network, addr string) (net.Conn, error) {
c, e := dial(ctx, network, addr)
nosigpipe.IgnoreSIGPIPE(c)
return c, e
}
p.dial = dial

if tr, ok := p.roundTripper.(*http.Transport); ok {
tr.DialContext = p.dial
Expand Down Expand Up @@ -221,7 +216,6 @@ func (p *Proxy) Serve(l net.Listener) error {
}

conn, err := l.Accept()
nosigpipe.IgnoreSIGPIPE(conn)
if err != nil {
var nerr net.Error
if ok := errors.As(err, &nerr); ok && nerr.Temporary() {
Expand Down

0 comments on commit ad48766

Please sign in to comment.