-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
☠️ windows: gate dial support behind build tag
For golang/go#67401.
- Loading branch information
1 parent
676234f
commit 8097f14
Showing
22 changed files
with
159 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//go:build windows && (!go1.23 || (go1.23 && tfogo_checklinkname0)) | ||
|
||
package tfo | ||
|
||
import ( | ||
|
2 changes: 1 addition & 1 deletion
2
netpoll_windows_go123.go → netpoll_windows_go123_checklinkname0.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
//go:build windows && go1.23 | ||
//go:build windows && go1.23 && tfogo_checklinkname0 | ||
|
||
package tfo | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//go:build !darwin && !freebsd && !linux && (!windows || (windows && go1.23 && !tfogo_checklinkname0)) | ||
|
||
package tfo | ||
|
||
func setTFODialer(_ uintptr) error { | ||
return ErrPlatformUnsupported | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build !darwin && !freebsd && !linux && !windows | ||
|
||
package tfo | ||
|
||
func setTFOListener(_ uintptr) error { | ||
return ErrPlatformUnsupported | ||
} | ||
|
||
func setTFOListenerWithBacklog(_ uintptr, _ int) error { | ||
return ErrPlatformUnsupported | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build !darwin && !freebsd && !linux && (!windows || (windows && go1.23 && !tfogo_checklinkname0)) | ||
|
||
package tfo | ||
|
||
import ( | ||
"context" | ||
"net" | ||
) | ||
|
||
const comptimeDialNoTFO = true | ||
|
||
func (d *Dialer) dialTFO(ctx context.Context, network, address string, b []byte) (*net.TCPConn, error) { | ||
if d.Fallback { | ||
return d.dialAndWriteTCPConn(ctx, network, address, b) | ||
} | ||
return nil, ErrPlatformUnsupported | ||
} | ||
|
||
func dialTCPAddr(_ string, _, _ *net.TCPAddr, _ []byte) (*net.TCPConn, error) { | ||
return nil, ErrPlatformUnsupported | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//go:build !darwin && !freebsd && !linux && !windows | ||
|
||
package tfo | ||
|
||
import ( | ||
"context" | ||
"net" | ||
) | ||
|
||
const comptimeListenNoTFO = true | ||
|
||
func (*ListenConfig) listenTFO(_ context.Context, _, _ string) (net.Listener, error) { | ||
return nil, ErrPlatformUnsupported | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//go:build !darwin && !freebsd && !linux && !windows | ||
|
||
package tfo | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestListenTFO(t *testing.T) { | ||
ln, err := Listen("tcp", "") | ||
if ln != nil { | ||
t.Error("Expected nil listener") | ||
} | ||
if err != ErrPlatformUnsupported { | ||
t.Errorf("Expected ErrPlatformUnsupported, got %v", err) | ||
} | ||
|
||
lntcp, err := ListenTCP("tcp", nil) | ||
if lntcp != nil { | ||
t.Error("Expected nil listener") | ||
} | ||
if err != ErrPlatformUnsupported { | ||
t.Errorf("Expected ErrPlatformUnsupported, got %v", err) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//go:build darwin || freebsd || linux || windows | ||
|
||
package tfo | ||
|
||
const comptimeListenNoTFO = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.