Code Review
/
src
/
xds
/
xds-cli.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
|
inline
| side by side (parent:
407b819
)
Only update Server URL when it's necessary.
v0.1.1
author
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Tue, 5 Dec 2017 13:57:56 +0000
(14:57 +0100)
committer
Sebastien Douheret
<sebastien.douheret@iot.bzh>
Tue, 5 Dec 2017 13:57:56 +0000
(14:57 +0100)
main.go
patch
|
blob
|
history
diff --git
a/main.go
b/main.go
index
ee0def8
..
0908140
100644
(file)
--- a/
main.go
+++ b/
main.go
@@
-360,8
+360,10
@@
func XdsConnInit(ctx *cli.Context) error {
return cli.NewExitError("ERROR while getting XDS config: "+err.Error(), 1)
}
svrCfg := xdsConf.Servers[XdsServerIndexGet()]
return cli.NewExitError("ERROR while getting XDS config: "+err.Error(), 1)
}
svrCfg := xdsConf.Servers[XdsServerIndexGet()]
- if serverURL != "" && (svrCfg.URL != serverURL || !svrCfg.Connected) {
- svrCfg.URL = serverURL
+ if (serverURL != "" && svrCfg.URL != serverURL) || !svrCfg.Connected {
+ if serverURL != "" {
+ svrCfg.URL = serverURL
+ }
svrCfg.ConnRetry = 10
if err := XdsConfigSet(xdsConf); err != nil {
return cli.NewExitError("ERROR while updating XDS server URL: "+err.Error(), 1)
svrCfg.ConnRetry = 10
if err := XdsConfigSet(xdsConf); err != nil {
return cli.NewExitError("ERROR while updating XDS server URL: "+err.Error(), 1)