rename module name from bt to go-bt
This commit is contained in:
@ -19,7 +19,7 @@ import (
|
||||
"errors"
|
||||
"net"
|
||||
|
||||
"github.com/xgfone/bt/bencode"
|
||||
"github.com/xgfone/go-bt/bencode"
|
||||
)
|
||||
|
||||
var errInvalidIP = errors.New("invalid ipv4 or ipv6")
|
||||
|
@ -19,16 +19,17 @@ import (
|
||||
"encoding/binary"
|
||||
"net"
|
||||
|
||||
"github.com/xgfone/bt/metainfo"
|
||||
"github.com/xgfone/go-bt/metainfo"
|
||||
)
|
||||
|
||||
// GenerateAllowedFastSet generates some allowed fast set of the torrent file.
|
||||
//
|
||||
// Argument:
|
||||
// set: generated piece set, the length of which is the number to be generated.
|
||||
// sz: the number of pieces in torrent.
|
||||
// ip: the of the remote peer of the connection.
|
||||
// infohash: infohash of torrent.
|
||||
//
|
||||
// set: generated piece set, the length of which is the number to be generated.
|
||||
// sz: the number of pieces in torrent.
|
||||
// ip: the of the remote peer of the connection.
|
||||
// infohash: infohash of torrent.
|
||||
//
|
||||
// BEP 6
|
||||
func GenerateAllowedFastSet(set []uint32, sz uint32, ip net.IP, infohash metainfo.Hash) {
|
||||
|
@ -18,7 +18,7 @@ import (
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
"github.com/xgfone/bt/metainfo"
|
||||
"github.com/xgfone/go-bt/metainfo"
|
||||
)
|
||||
|
||||
func TestGenerateAllowedFastSet(t *testing.T) {
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/xgfone/bt/metainfo"
|
||||
"github.com/xgfone/go-bt/metainfo"
|
||||
)
|
||||
|
||||
var errInvalidProtocolHeader = fmt.Errorf("unexpected peer protocol header string")
|
||||
|
@ -14,9 +14,7 @@
|
||||
|
||||
package peerprotocol
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
import "testing"
|
||||
|
||||
func TestBitField(t *testing.T) {
|
||||
bf := NewBitFieldFromBools([]bool{
|
||||
|
@ -21,8 +21,8 @@ import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/xgfone/bt/bencode"
|
||||
"github.com/xgfone/bt/metainfo"
|
||||
"github.com/xgfone/go-bt/bencode"
|
||||
"github.com/xgfone/go-bt/metainfo"
|
||||
)
|
||||
|
||||
// Predefine some errors about extension support.
|
||||
|
@ -22,7 +22,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/xgfone/bt/metainfo"
|
||||
"github.com/xgfone/go-bt/metainfo"
|
||||
)
|
||||
|
||||
// Handler is used to handle the incoming peer connection.
|
||||
|
Reference in New Issue
Block a user