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

Unified Diff: logdog/client/butler/output/logdog/output.go

Issue 2227113002: Update bulidbucket client (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: rebase Created 4 years, 4 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 | « grpc/cmd/rpc/main.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: logdog/client/butler/output/logdog/output.go
diff --git a/logdog/client/butler/output/logdog/output.go b/logdog/client/butler/output/logdog/output.go
index 54559d2f14b4803eb214db06be6f4515a89e1df9..9b4576fae41f3c93deecd6349aa4db1debebdac4 100644
--- a/logdog/client/butler/output/logdog/output.go
+++ b/logdog/client/butler/output/logdog/output.go
@@ -7,13 +7,13 @@ package logdog
import (
"fmt"
"runtime"
- "strings"
"time"
"github.com/luci/luci-go/common/auth"
"github.com/luci/luci-go/common/config"
"github.com/luci/luci-go/common/errors"
ps "github.com/luci/luci-go/common/gcloud/pubsub"
+ "github.com/luci/luci-go/common/lhttp"
log "github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/common/proto/google"
"github.com/luci/luci-go/common/retry"
@@ -107,7 +107,7 @@ func (cfg *Config) Register(c context.Context) (output.Output, error) {
}
// If our host begins with "localhost", set insecure option automatically.
- if isLocalHost(cfg.Host) {
+ if lhttp.IsLocalHost(cfg.Host) {
log.Infof(c, "Detected localhost; enabling insecure RPC connection.")
client.Options.Insecure = true
}
@@ -205,19 +205,6 @@ func (cfg *Config) Register(c context.Context) (output.Output, error) {
}), nil
}
-func isLocalHost(host string) bool {
- switch {
- case host == "localhost", strings.HasPrefix(host, "localhost:"):
- case host == "127.0.0.1", strings.HasPrefix(host, "127.0.0.1:"):
- case host == "[::1]", strings.HasPrefix(host, "[::1]:"):
- case strings.HasPrefix(host, ":"):
-
- default:
- return false
- }
- return true
-}
-
func retryTopicExists(ctx context.Context, t *pubsub.Topic) (bool, error) {
var exists bool
err := retry.Retry(ctx, retry.Default, func() (err error) {
« no previous file with comments | « grpc/cmd/rpc/main.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698