mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-26 08:13:09 -06:00
API tweaks
This commit is contained in:
parent
f95a9c9d90
commit
8762421bc2
|
|
@ -105,13 +105,13 @@ func (m *DendriteMonolith) DisconnectPort(port int) error {
|
||||||
|
|
||||||
func (m *DendriteMonolith) Conduit(zone string) (*Conduit, error) {
|
func (m *DendriteMonolith) Conduit(zone string) (*Conduit, error) {
|
||||||
l, r := net.Pipe()
|
l, r := net.Pipe()
|
||||||
var p types.SwitchPortID
|
conduit := &Conduit{conn: r, port: 0}
|
||||||
go func() {
|
go func() {
|
||||||
loop:
|
loop:
|
||||||
for i := 1; i <= 10; i++ {
|
for i := 1; i <= 10; i++ {
|
||||||
logrus.Errorf("Attempting authenticated connect (attempt %d)", i)
|
logrus.Errorf("Attempting authenticated connect (attempt %d)", i)
|
||||||
var err error
|
var err error
|
||||||
p, err = m.PineconeRouter.AuthenticatedConnect(l, zone)
|
conduit.port, err = m.PineconeRouter.AuthenticatedConnect(l, zone)
|
||||||
switch err {
|
switch err {
|
||||||
case io.ErrClosedPipe:
|
case io.ErrClosedPipe:
|
||||||
logrus.Errorf("Authenticated connect failed due to closed pipe (attempt %d)", i)
|
logrus.Errorf("Authenticated connect failed due to closed pipe (attempt %d)", i)
|
||||||
|
|
@ -130,7 +130,7 @@ func (m *DendriteMonolith) Conduit(zone string) (*Conduit, error) {
|
||||||
_ = l.Close()
|
_ = l.Close()
|
||||||
_ = r.Close()
|
_ = r.Close()
|
||||||
}()
|
}()
|
||||||
return &Conduit{conn: r, port: p}, nil
|
return conduit, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *DendriteMonolith) RegisterUser(localpart, password string) (string, error) {
|
func (m *DendriteMonolith) RegisterUser(localpart, password string) (string, error) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue