Use helper for forwarding

This commit is contained in:
Alex Dadgar
2018-02-08 15:00:22 -08:00
parent 0fb2b5c3f3
commit e05cd42063
4 changed files with 36 additions and 93 deletions

View File

@@ -10,6 +10,8 @@ func (s *HTTPServer) rpcHandlerForAlloc(allocID string) (localClient, remoteClie
// See if the local client can handle the request.
localAlloc := false
if c != nil {
// If there is an error it means that the client doesn't have the
// allocation so we can't use the local client
_, err := c.GetClientAlloc(allocID)
if err == nil {
localAlloc = true