From a808b4692656c10bb43e2d54a2f5ef2746d231d5 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Wed, 1 Nov 2023 16:17:41 -0600 Subject: allow titan uploads in the meta-client fixes #18 --- tools/sw-fetch/main.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'tools/sw-fetch') diff --git a/tools/sw-fetch/main.go b/tools/sw-fetch/main.go index 8591fe2..c2cb3e8 100644 --- a/tools/sw-fetch/main.go +++ b/tools/sw-fetch/main.go @@ -1,7 +1,6 @@ package main import ( - "bytes" "crypto/tls" "fmt" "io" @@ -38,12 +37,7 @@ func main() { var err error if conf.upload { - body, er := stdinContents() - if er != nil { - err = er - } else { - response, err = cl.Upload(conf.url.String(), body) - } + response, err = cl.Upload(conf.url.String(), os.Stdin) } else { response, err = cl.Fetch(conf.url.String()) } @@ -155,17 +149,6 @@ func failf(msg string, args ...any) { os.Exit(1) } -func stdinContents() (*io.LimitedReader, error) { - contents, err := io.ReadAll(os.Stdin) - if err != nil { - return nil, err - } - return &io.LimitedReader{ - R: bytes.NewBuffer(contents), - N: int64(len(contents)), - }, nil -} - func printResponse(response *sliderule.Response, conf config) bool { success := true -- cgit v1.2.3