(err error, stats *statistics.ServerStatistics)
| 126 | } |
| 127 | |
| 128 | func failBlacklistableError(err error, stats *statistics.ServerStatistics) (until time.Time, blacklisted bool) { |
| 129 | if err == nil { |
| 130 | return |
| 131 | } |
| 132 | mxerr, ok := err.(gomatrix.HTTPError) |
| 133 | if !ok { |
| 134 | return stats.Failure() |
| 135 | } |
| 136 | if mxerr.Code == 401 { // invalid signature in X-Matrix header |
| 137 | return stats.Failure() |
| 138 | } |
| 139 | if mxerr.Code >= 500 && mxerr.Code < 600 { // internal server errors |
| 140 | return stats.Failure() |
| 141 | } |
| 142 | return |
| 143 | } |
| 144 | |
| 145 | func (a *FederationInternalAPI) doRequestIfNotBackingOffOrBlacklisted( |
| 146 | s gomatrixserverlib.ServerName, request func() (interface{}, error), |
no test coverage detected