Skip to content

Commit

Permalink
PS: Handle ISD-local AS-wildcard seg requests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukedirtwalker committed Jan 4, 2019
1 parent 3585c3b commit af90342
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions go/path_srv/internal/handlers/segreqnoncore.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,6 @@ func (h *segReqNonCoreHandler) handleCoreDst(ctx context.Context, segReq *path_m
msger infra.Messenger, dst addr.IA, coreASes []addr.IA) {

logger := log.FromCtx(ctx)
dstISDLocal := segReq.DstIA().I == h.localIA.I
logger.Debug("[segReqHandler] handleCoreDst", "remote", dstISDLocal)
upSegs, err := h.fetchUpSegsFromDB(ctx, coreASes, !segReq.Flags.CacheOnly)
if err != nil {
logger.Error("[segReqHandler] Failed to find up segments", "err", err)
Expand All @@ -116,6 +114,11 @@ func (h *segReqNonCoreHandler) handleCoreDst(ctx context.Context, segReq *path_m
h.sendEmptySegReply(ctx, segReq, msger)
return
}
// For a local wildcard we return the upSegs.
if segReq.DstIA().A == 0 && segReq.DstIA().I == h.localIA.I {
h.sendReply(ctx, msger, upSegs, nil, nil, segReq)
return
}
// TODO(lukedirtwalker): in case of CacheOnly we can use a single query,
// else we should start go routines for the core segs here.
var coreSegs []*seg.PathSegment
Expand Down

0 comments on commit af90342

Please sign in to comment.