فهرست منبع

Fix: avoid import cycle

Rod Hynes 8 سال پیش
والد
کامیت
9d2b07d505
1فایلهای تغییر یافته به همراه6 افزوده شده و 3 حذف شده
  1. 6 3
      psiphon/common/crypto/ssh/channel.go

+ 6 - 3
psiphon/common/crypto/ssh/channel.go

@@ -11,8 +11,6 @@ import (
 	"io"
 	"io"
 	"log"
 	"log"
 	"sync"
 	"sync"
-
-	"github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/protocol"
 )
 )
 
 
 const (
 const (
@@ -57,7 +55,12 @@ const (
 //   channel; we still select a size smaller than the stock
 //   channel; we still select a size smaller than the stock
 //   channelWindowSize due to client memory constraints.
 //   channelWindowSize due to client memory constraints.
 func getChannelWindowSize(chanType string) int {
 func getChannelWindowSize(chanType string) int {
-	if chanType == protocol.PACKET_TUNNEL_CHANNEL_TYPE {
+
+	// From "github.com/Psiphon-Labs/psiphon-tunnel-core/psiphon/common/protocol".
+	// Copied here to avoid import cycle.
+	packetTunnelChannelType := "tun@psiphon.ca"
+
+	if chanType == packetTunnelChannelType {
 		return 16 * channelMaxPacket
 		return 16 * channelMaxPacket
 	}
 	}
 	return 4 * channelMaxPacket
 	return 4 * channelMaxPacket