diff options
| author | Marwan Sulaiman <marwan@tailscale.com> | 2023-09-05 13:51:52 -0400 |
|---|---|---|
| committer | Marwan Sulaiman <marwan@tailscale.com> | 2023-09-05 13:51:52 -0400 |
| commit | ce16658ac0e032e9524bac8f5fc926b11f82a7a7 (patch) | |
| tree | 7ccf2dd7c97b1d5996c4ca709818edc529b34f81 /client | |
| parent | a4aa6507fa3afa586dc3cbbf85f2cae852622b9e (diff) | |
| download | tailscale-marwan/postmem.tar.xz tailscale-marwan/postmem.zip | |
ipn, ipn/ipnlocal: add Foreground field for ServeConfigmarwan/postmem
This PR adds a new field to the serve config that can be used to identify which serves are in "foreground mode" and then can also be used to ensure they do not get persisted to disk so that if Tailscaled gets ungracefully shutdown, the reloaded ServeConfig will not have those ports opened.
Updates #8489
Signed-off-by: Marwan Sulaiman <marwan@tailscale.com>
Diffstat (limited to 'client')
| -rw-r--r-- | client/tailscale/localclient.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/client/tailscale/localclient.go b/client/tailscale/localclient.go index 9fcc8aaf2..af46f896e 100644 --- a/client/tailscale/localclient.go +++ b/client/tailscale/localclient.go @@ -1094,29 +1094,6 @@ func (lc *LocalClient) NetworkLockDisable(ctx context.Context, secret []byte) er return nil } -// StreamServe returns an io.ReadCloser that streams serve/Funnel -// connections made to the provided HostPort. -// -// If Serve and Funnel were not already enabled for the HostPort in the ServeConfig, -// the backend enables it for the duration of the context's lifespan and -// then turns it back off once the context is closed. If either are already enabled, -// then they remain that way but logs are still streamed -func (lc *LocalClient) StreamServe(ctx context.Context, hp ipn.ServeStreamRequest) (io.ReadCloser, error) { - req, err := http.NewRequestWithContext(ctx, "POST", "http://"+apitype.LocalAPIHost+"/localapi/v0/stream-serve", jsonBody(hp)) - if err != nil { - return nil, err - } - res, err := lc.doLocalRequestNiceError(req) - if err != nil { - return nil, err - } - if res.StatusCode != 200 { - res.Body.Close() - return nil, errors.New(res.Status) - } - return res.Body, nil -} - // GetServeConfig return the current serve config. // // If the serve config is empty, it returns (nil, nil). |
