Browse Source

Disable routing for platform initialized detour

Shelikhoo 4 years ago
parent
commit
9722488fd6
1 changed files with 11 additions and 11 deletions
  1. 11 11
      app/dispatcher/default.go

+ 11 - 11
app/dispatcher/default.go

@@ -305,19 +305,19 @@ func (d *DefaultDispatcher) routedDispatch(ctx context.Context, link *transport.
 			common.Interrupt(link.Reader)
 			return
 		}
-	}
-
-	if d.router != nil {
-		if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil {
-			tag := route.GetOutboundTag()
-			if h := d.ohm.GetHandler(tag); h != nil {
-				newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx))
-				handler = h
+	} else {
+		if d.router != nil {
+			if route, err := d.router.PickRoute(routing_session.AsRoutingContext(ctx)); err == nil {
+				tag := route.GetOutboundTag()
+				if h := d.ohm.GetHandler(tag); h != nil {
+					newError("taking detour [", tag, "] for [", destination, "]").WriteToLog(session.ExportIDToError(ctx))
+					handler = h
+				} else {
+					newError("non existing tag: ", tag).AtWarning().WriteToLog(session.ExportIDToError(ctx))
+				}
 			} else {
-				newError("non existing tag: ", tag).AtWarning().WriteToLog(session.ExportIDToError(ctx))
+				newError("default route for ", destination).WriteToLog(session.ExportIDToError(ctx))
 			}
-		} else {
-			newError("default route for ", destination).WriteToLog(session.ExportIDToError(ctx))
 		}
 	}