This commit is contained in:
Łukasz Magiera 2022-05-24 16:22:52 +02:00
parent df7709c2e2
commit b53db68bda
2 changed files with 5 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/filecoin-project/lotus/lib/httpreader"
"io"
"math"
"net/http"
@ -25,6 +24,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/sector-storage/sealtasks"
"github.com/filecoin-project/lotus/extern/sector-storage/storiface"
"github.com/filecoin-project/lotus/lib/httpreader"
"github.com/filecoin-project/lotus/chain/types"
lcli "github.com/filecoin-project/lotus/cli"

View File

@ -5,7 +5,6 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/filecoin-project/lotus/lib/httpreader"
"io"
"io/ioutil"
"net/http"
@ -24,6 +23,7 @@ import (
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/lotus/extern/storage-sealing/lib/nullreader"
"github.com/filecoin-project/lotus/lib/httpreader"
)
var log = logging.Logger("rpcenc")
@ -35,7 +35,7 @@ type StreamType string
const (
Null StreamType = "null"
PushStream StreamType = "push"
HttpUrl StreamType = "http"
HTTP StreamType = "http"
// TODO: Data transfer handoff to workers?
)
@ -108,7 +108,7 @@ func ReaderParamEncoder(addr string) jsonrpc.Option {
return reflect.ValueOf(ReaderStream{Type: Null, Info: fmt.Sprint(r.N)}), nil
}
if r, ok := r.(*httpreader.HttpReader); ok && r.URL != "" {
return reflect.ValueOf(ReaderStream{Type: HttpUrl, Info: r.URL}), nil
return reflect.ValueOf(ReaderStream{Type: HTTP, Info: r.URL}), nil
}
reqID := uuid.New()
@ -426,7 +426,7 @@ func ReaderParamDecoder() (http.HandlerFunc, jsonrpc.ServerOption) {
}
return reflect.ValueOf(nullreader.NewNullReader(abi.UnpaddedPieceSize(n))), nil
case HttpUrl:
case HTTP:
return reflect.ValueOf(&httpreader.HttpReader{URL: rs.Info}), nil
}