diff options
| author | Percy Wegmann <percy@tailscale.com> | 2025-06-12 14:31:09 -0500 |
|---|---|---|
| committer | Percy Wegmann <percy@tailscale.com> | 2025-06-12 14:31:09 -0500 |
| commit | 224776df6aec3cdf14f6843e691b1aec0846992b (patch) | |
| tree | 14f2c73f01e60606979b8d33b317e78dc39b4559 | |
| parent | db34cdcfe7d4825ed8a7edec3f6c0164b3c85b5a (diff) | |
| download | tailscale-percy/drive-verbose.tar.xz tailscale-percy/drive-verbose.zip | |
More verbose Taildrive logging, DO NOT MERGE TO mainpercy/drive-verbose
Signed-off-by: Percy Wegmann <percy@tailscale.com>
| -rw-r--r-- | ipn/ipnlocal/peerapi.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ipn/ipnlocal/peerapi.go b/ipn/ipnlocal/peerapi.go index 60dd41024..620f9ca6a 100644 --- a/ipn/ipnlocal/peerapi.go +++ b/ipn/ipnlocal/peerapi.go @@ -1015,12 +1015,14 @@ func (rbw *requestBodyWrapper) Read(b []byte) (int, error) { } func (h *peerAPIHandler) handleServeDrive(w http.ResponseWriter, r *http.Request) { + h.logf("taildrive: handleServeDrive: received peerapi request %s: %q", r.Method, r.URL.Path) if !h.ps.b.DriveSharingEnabled() { h.logf("taildrive: not enabled") http.Error(w, "taildrive not enabled", http.StatusNotFound) return } + h.logf("taildrive: handleServeDrive: checking peer caps") capsMap := h.PeerCaps() driveCaps, ok := capsMap[tailcfg.PeerCapabilityTaildrive] if !ok { @@ -1034,6 +1036,7 @@ func (h *peerAPIHandler) handleServeDrive(w http.ResponseWriter, r *http.Request rawPerms = append(rawPerms, []byte(cap)) } + h.logf("taildrive: handleServeDrive: parsing permissions") p, err := drive.ParsePermissions(rawPerms) if err != nil { h.logf("taildrive: error parsing permissions: %v", err) @@ -1041,6 +1044,7 @@ func (h *peerAPIHandler) handleServeDrive(w http.ResponseWriter, r *http.Request return } + h.logf("taildrive: handleServeDrive: getting DriveForRemote") fs, ok := h.ps.b.sys.DriveForRemote.GetOK() if !ok { h.logf("taildrive: not supported on platform") @@ -1055,6 +1059,10 @@ func (h *peerAPIHandler) handleServeDrive(w http.ResponseWriter, r *http.Request } r.Body = bw + defer func() { + h.logf("taildrive: after ServeHTTPWithPerms to %q, status was %d", r.URL.Path, wr.statusCode) + }() + if r.Method == httpm.PUT || r.Method == httpm.GET { defer func() { switch wr.statusCode { @@ -1072,6 +1080,7 @@ func (h *peerAPIHandler) handleServeDrive(w http.ResponseWriter, r *http.Request } r.URL.Path = strings.TrimPrefix(r.URL.Path, taildrivePrefix) + h.logf("taildrive: handleServeDrive: calling ServeHTTPWithPerms at: %s", r.URL.Path) fs.ServeHTTPWithPerms(p, wr, r) } |
