mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 13:18:53 +00:00
net/portmapper: fire an event when a port mapping is updated (#15371)
When an event bus is configured publish an event each time a new port mapping is updated. Publication is unconditional and occurs prior to calling any callback that is registered. For now, the callback is still fired in a separate goroutine as before -- later, those callbacks should become subscriptions to the published event. For now, the event type is defined as a new type here in the package. We will want to move it to a more central package when there are subscribers. The event wrapper is effectively a subset of the data exported by the internal mapping interface, but on a concrete struct so the bus plumbing can inspect it. Updates #15160 Change-Id: I951f212429ac791223af8d75b6eb39a0d2a0053a Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
This commit is contained in:

committed by
M. J. Fromberger

parent
deb0b255ff
commit
2731171c5e
@@ -163,9 +163,8 @@ func TestSelectBestService(t *testing.T) {
|
||||
Desc: rootDesc,
|
||||
Control: tt.control,
|
||||
})
|
||||
c := newTestClient(t, igd)
|
||||
c := newTestClient(t, igd, nil)
|
||||
t.Logf("Listening on upnp=%v", c.testUPnPPort)
|
||||
defer c.Close()
|
||||
|
||||
// Ensure that we're using the HTTP client that talks to our test IGD server
|
||||
ctx := context.Background()
|
||||
|
Reference in New Issue
Block a user