diff options
Diffstat (limited to 'mc/mc.go')
| -rw-r--r-- | mc/mc.go | 25 |
1 files changed, 25 insertions, 0 deletions
@@ -13,6 +13,7 @@ var chunkSize int = 5000 type MeasurableConnection interface { Start(context.Context, bool) bool Transferred() uint64 + Client() *http.Client } type LoadBearingDownload struct { @@ -25,10 +26,30 @@ func (lbd *LoadBearingDownload) Transferred() uint64 { return lbd.downloaded } +func (lbd *LoadBearingDownload) Client() *http.Client { + return lbd.client +} + func (lbd *LoadBearingDownload) Start(ctx context.Context, debug bool) bool { lbd.downloaded = 0 lbd.client = &http.Client{} + // At some point this might be useful: It is a snippet of code that will enable + // logging of per-session TLS key material in order to make debugging easier in + // Wireshark. + /* + lbd.client = &http.Client{ + Transport: &http2.Transport{ + TLSClientConfig: &tls.Config{ + KeyLogWriter: w, + + Rand: utilities.RandZeroSource{}, // for reproducible output; don't do this. + InsecureSkipVerify: true, // test server certificate is not trusted. + }, + }, + } + */ + if debug { fmt.Printf("Started a load bearing download.\n") } @@ -64,6 +85,10 @@ func (lbu *LoadBearingUpload) Transferred() uint64 { return lbu.uploaded } +func (lbd *LoadBearingUpload) Client() *http.Client { + return lbd.client +} + type syntheticCountingReader struct { n *uint64 ctx context.Context |
