mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-21 05:43:09 -06:00
Update comments from review
This commit is contained in:
parent
5a7e332d1f
commit
740db77e5b
|
|
@ -157,11 +157,17 @@ func (s *ServerKeyAPI) handleDatabaseKeys(
|
||||||
|
|
||||||
// We successfully got some keys. Add them to the results.
|
// We successfully got some keys. Add them to the results.
|
||||||
for req, res := range dbResults {
|
for req, res := range dbResults {
|
||||||
|
// The key we've retrieved from the database/cache might
|
||||||
|
// have passed its validity period, but right now, it's
|
||||||
|
// the best thing we've got, and it might be sufficient to
|
||||||
|
// verify a past event.
|
||||||
results[req] = res
|
results[req] = res
|
||||||
|
|
||||||
// If the key is valid right now then we can also remove it
|
// If the key is valid right now then we can also remove it
|
||||||
// from the request list as we don't need to fetch it again
|
// from the request list as we don't need to fetch it again
|
||||||
// in that case.
|
// in that case. If the key isn't valid right now, then by
|
||||||
|
// leaving it in the 'requests' map, we'll try to update the
|
||||||
|
// key using the fetchers in handleFetcherKeys.
|
||||||
if res.WasValidAt(now, true) {
|
if res.WasValidAt(now, true) {
|
||||||
delete(requests, req)
|
delete(requests, req)
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +175,7 @@ func (s *ServerKeyAPI) handleDatabaseKeys(
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleDatabaseKeys handles cases where a fetcher can satisfy
|
// handleFetcherKeys handles cases where a fetcher can satisfy
|
||||||
// the remaining requests.
|
// the remaining requests.
|
||||||
func (s *ServerKeyAPI) handleFetcherKeys(
|
func (s *ServerKeyAPI) handleFetcherKeys(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,12 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type server struct {
|
type server struct {
|
||||||
name gomatrixserverlib.ServerName
|
name gomatrixserverlib.ServerName // server name
|
||||||
validity time.Duration
|
validity time.Duration // key validity duration from now
|
||||||
config *config.Dendrite
|
config *config.Dendrite // skeleton config, from TestMain
|
||||||
fedclient *gomatrixserverlib.FederationClient
|
fedclient *gomatrixserverlib.FederationClient // uses MockRoundTripper
|
||||||
cache *caching.Caches
|
cache *caching.Caches // server-specific cache
|
||||||
api api.ServerKeyInternalAPI
|
api api.ServerKeyInternalAPI // server-specific server key API
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *server) renew() {
|
func (s *server) renew() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue