Files
rclone/fs/dump.go
Nick Craig-Wood 16091ce365 fshttp: add --dump trace to log connection level events via httptrace
The new "trace" dump flag attaches a net/http/httptrace ClientTrace to
each HTTP transaction and logs the connection level events - DNS
resolution, TCP connect, TLS handshake (including the negotiated TLS
version, cipher, ALPN protocol and server certificate), connection
reuse, request write and time to first response byte. Each line is
tagged with the time elapsed since the start of the transaction and the
request pointer so it can be correlated with the other dumps.

This is complementary to the existing dump flags: it shows how the
connection behaved rather than what was sent, which is useful for
debugging connectivity, DNS, TLS, proxy and keep-alive problems.
2026-06-11 21:29:45 +01:00

47 lines
998 B
Go

package fs
// DumpFlags describes the Dump options in force
type DumpFlags = Bits[dumpChoices]
// DumpFlags definitions
const (
DumpHeaders DumpFlags = 1 << iota
DumpBodies
DumpRequests
DumpResponses
DumpAuth
DumpFilters
DumpGoRoutines
DumpOpenFiles
DumpMapper
DumpCurl
DumpErrors
DumpTrace
)
type dumpChoices struct{}
func (dumpChoices) Choices() []BitsChoicesInfo {
return []BitsChoicesInfo{
{uint64(DumpHeaders), "headers"},
{uint64(DumpBodies), "bodies"},
{uint64(DumpRequests), "requests"},
{uint64(DumpResponses), "responses"},
{uint64(DumpAuth), "auth"},
{uint64(DumpFilters), "filters"},
{uint64(DumpGoRoutines), "goroutines"},
{uint64(DumpOpenFiles), "openfiles"},
{uint64(DumpMapper), "mapper"},
{uint64(DumpCurl), "curl"},
{uint64(DumpErrors), "errors"},
{uint64(DumpTrace), "trace"},
}
}
func (dumpChoices) Type() string {
return "DumpFlags"
}
// DumpFlagsList is a list of dump flags used in the help
var DumpFlagsList = DumpHeaders.Help()