-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
package gogotelehash | ||
package telehash | ||
|
||
import ( | ||
"encoding/json" | ||
"net" | ||
"time" | ||
|
||
"github.com/telehash/gogotelehash/e3x" | ||
"github.com/telehash/gogotelehash/hashname" | ||
"github.com/telehash/gogotelehash/lob" | ||
"github.com/telehash/gogotelehash/internal/hashname" | ||
"github.com/telehash/gogotelehash/internal/lob" | ||
"github.com/telehash/gogotelehash/transports" | ||
|
||
// "github.com/telehash/gogotelehash/modules/bridge" | ||
"github.com/telehash/gogotelehash/modules/paths" | ||
"github.com/telehash/gogotelehash/internal/modules/bridge" | ||
"github.com/telehash/gogotelehash/internal/modules/paths" | ||
) | ||
|
||
type ( | ||
|
@@ -26,20 +26,16 @@ type ( | |
Packet lob.Packet | ||
) | ||
|
||
// func Bridge() EndpointOption { | ||
// return EndpointOption(bridge.Module()) | ||
// } | ||
|
||
func Paths() EndpointOption { | ||
return EndpointOption(paths.Module()) | ||
} | ||
|
||
func Transport(config transports.Config) EndpointOption { | ||
return EndpointOption(e3x.Transport(config)) | ||
} | ||
|
||
func Open(options ...EndpointOption) (*Endpoint, error) { | ||
innerOptions := make([]e3x.EndpointOption, len(options)) | ||
innerOptions := make([]e3x.EndpointOption, len(options)+10) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
fd
Author
Contributor
|
||
|
||
innerOptions = append(innerOptions, paths.Module()) | ||
innerOptions = append(innerOptions, bridge.Module(bridge.Config{})) | ||
|
||
for i, option := range options { | ||
innerOptions[i] = e3x.EndpointOption(option) | ||
} | ||
|
@@ -196,3 +192,7 @@ func (i *Identity) Identify(e *e3x.Endpoint) (*e3x.Identity, error) { | |
func (p *Packet) Header() *lob.Header { | ||
return (*lob.Packet)(p).Header() | ||
} | ||
|
||
func (p *Packet) Free() { | ||
(*lob.Packet)(p).Free() | ||
} |
Why have '+10' been added here?
It results in failure to setOptions at:
And everything fails with panic...