Skip to content

Commit

Permalink
More logging; new 'properties' section in directory entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
KIProtect GmbH committed May 23, 2022
1 parent e05b143 commit 390c5a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion channels/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,13 @@ func (c *GRPCClientChannel) clearStaleConnections() error {
eps.Log.Error(err)
lastErr = err
}
eps.Log.Tracef("Removing stale connection with name '%s' and address '%s'...", connection.Name, connection.Address)
delete(c.connections, key)
} else {
eps.Log.Tracef("Keeping connection with name '%s' and address '%s' open...", connection.Name, connection.Address)
}
}
eps.Log.Tracef("%d open gRPC server-client connections in total...", len(c.connections))
return lastErr
}

Expand Down Expand Up @@ -342,6 +346,8 @@ func (c *GRPCClientChannel) openConnections() error {

func (c *GRPCClientChannel) openConnection(address, name string) error {

eps.Log.Tracef("Opening gRPC client connection to name '%s' and address '%s'...", name, address)

conn := c.getConnection(name)

if conn == nil {
Expand Down Expand Up @@ -419,12 +425,14 @@ func (c *GRPCClientChannel) DeliverRequest(request *eps.Request) (*eps.Response,

if settings.Proxy != "" {

eps.Log.Tracef("Destination is only reachable via proxy '%s'...", settings.Proxy)

if !c.Settings.UseProxy {
return nil, fmt.Errorf("destination is only reachable via proxy but proxying is disabled")
}

dialer = func(context context.Context, addr string) (net.Conn, error) {
eps.Log.Tracef("Dialing to %s through proxy...", address.Operator)
eps.Log.Tracef("Dialing operator '%s' through proxy...", address.Operator)

// this request comes from ourselves
clientInfo := &eps.ClientInfo{
Expand Down
1 change: 1 addition & 0 deletions directory.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func MakeDirectoryEntry() *DirectoryEntry {
Certificates: []*OperatorCertificate{},
Settings: []*OperatorSettings{},
Records: []*SignedChangeRecord{},
Properties: &OperatorProperties{},
}
}

Expand Down
2 changes: 2 additions & 0 deletions message_broker.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ func (b *BasicMessageBroker) DeliverRequest(request *Request, clientInfo *Client
return nil, fmt.Errorf("client info missing")
}

Log.Tracef("Delivering request with method '%s' from client '%s'...", request.Method, clientInfo.Name)

var ownEntry, remoteEntry *DirectoryEntry
var err error

Expand Down

0 comments on commit 390c5a9

Please sign in to comment.