Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(985)

Unified Diff: server/prpc/decoding.go

Issue 1637193002: common/prpc, tools/cmd/cproto: prpc client (Closed) Base URL: https://github.com/luci/luci-go@prpc-server
Patch Set: Add some content length tests. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/retry/transient.go ('k') | server/prpc/decoding_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/prpc/decoding.go
diff --git a/server/prpc/decoding.go b/server/prpc/decoding.go
index a6ae48875be64d3054ac16146ab3ffff67b8ef32..cc3285b66c2551930500b2f36fcb1ec0cbcb4e81 100644
--- a/server/prpc/decoding.go
+++ b/server/prpc/decoding.go
@@ -19,6 +19,7 @@ import (
"google.golang.org/grpc/metadata"
"github.com/luci/luci-go/common/clock"
+ prpccommon "github.com/luci/luci-go/common/prpc"
)
// This file implements decoding of HTTP requests to RPC parameters.
@@ -94,7 +95,7 @@ func readMessage(r *http.Request, msg proto.Message) *protocolError {
}
// parseHeader parses HTTP headers and derives a new context.
-// Supports headerTimeout.
+// Supports HeaderTimeout.
// Ignores "Accept" and "Content-Type" headers.
//
// If there are unrecognized HTTP headers, with or without headerSuffixBinary,
@@ -120,12 +121,12 @@ func parseHeader(c context.Context, header http.Header) (context.Context, error)
name = http.CanonicalHeaderKey(name)
switch name {
- case headerTimeout:
+ case prpccommon.HeaderTimeout:
// Decode only first value, ignore the rest
// to be consistent with http.Header.Get.
- timeout, err := decodeTimeout(values[0])
+ timeout, err := prpccommon.DecodeTimeout(values[0])
if err != nil {
- return origC, fmt.Errorf("%s header: %s", headerTimeout, err)
+ return origC, fmt.Errorf("%s header: %s", prpccommon.HeaderTimeout, err)
}
c, _ = clock.WithTimeout(c, timeout)
« no previous file with comments | « common/retry/transient.go ('k') | server/prpc/decoding_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698