Merge lp:~thumper/juju-core/fix-default-http into lp:~go-bot/juju-core/trunk

Proposed by Tim Penhey
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 1997
Proposed branch: lp:~thumper/juju-core/fix-default-http
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 19 lines (+3/-3)
1 file modified
cmd/cmd.go (+3/-3)
To merge this branch: bzr merge lp:~thumper/juju-core/fix-default-http
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+192034@code.launchpad.net

Commit message

Don't replace the default http transport.

The local provider is currently broken as the file protocol
is registered in one init block, and the default transport
is replaced in another init block.

This change just avoids replacing the default transport in
an init block.

Description of the change

Don't replace the default http transport.

The local provider is currently broken as the file protocal
is registered in one init block, and the default transport
is replaced in another init block.

This change just avoids replacing the default transport in
an init block.

https://codereview.appspot.com/15660043/

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Reviewers: mp+192034_code.launchpad.net,

Message:
Please take a look.

Description:
Don't replace the default http transport.

The local provider is currently broken as the file protocal
is registered in one init block, and the default transport
is replaced in another init block.

This change just avoids replacing the default transport in
an init block.

https://code.launchpad.net/~thumper/juju-core/fix-default-http/+merge/192034

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/15660043/

Affected files (+5, -3 lines):
   A [revision details]
   M cmd/cmd.go

Index: [revision details]
=== added file '[revision details]'
--- [revision details] 2012-01-01 00:00:00 +0000
+++ [revision details] 2012-01-01 00:00:00 +0000
@@ -0,0 +1,2 @@
+Old revision: tarmac-20131018031007-g87i6t5sgxtr7gxl
+New revision: <email address hidden>

Index: cmd/cmd.go
=== modified file 'cmd/cmd.go'
--- cmd/cmd.go 2013-10-17 22:48:19 +0000
+++ cmd/cmd.go 2013-10-21 18:10:36 +0000
@@ -15,12 +15,12 @@
   "strings"

   "launchpad.net/gnuflag"
-
- "launchpad.net/juju-core/utils"
  )

  func init() {
- http.DefaultTransport = utils.NewHttpTransport()
+ // Don't replace the default transport as other init blocks
+ // register protocols.
+ http.DefaultTransport.(*http.Transport).DisableKeepAlives = true
  }

  // ErrSilent can be returned from Run to signal that Main should exit with

Revision history for this message
Dave Cheney (dave-cheney) wrote :

LGTM.

On Tue, Oct 22, 2013 at 5:24 AM, Tim Penhey <email address hidden> wrote:
> Reviewers: mp+192034_code.launchpad.net,
>
> Message:
> Please take a look.
>
> Description:
> Don't replace the default http transport.
>
> The local provider is currently broken as the file protocal
> is registered in one init block, and the default transport
> is replaced in another init block.
>
> This change just avoids replacing the default transport in
> an init block.
>
> https://code.launchpad.net/~thumper/juju-core/fix-default-http/+merge/192034
>
> (do not edit description out of merge proposal)
>
>
> Please review this at https://codereview.appspot.com/15660043/
>
> Affected files (+5, -3 lines):
> A [revision details]
> M cmd/cmd.go
>
>
> Index: [revision details]
> === added file '[revision details]'
> --- [revision details] 2012-01-01 00:00:00 +0000
> +++ [revision details] 2012-01-01 00:00:00 +0000
> @@ -0,0 +1,2 @@
> +Old revision: tarmac-20131018031007-g87i6t5sgxtr7gxl
> +New revision: <email address hidden>
>
> Index: cmd/cmd.go
> === modified file 'cmd/cmd.go'
> --- cmd/cmd.go 2013-10-17 22:48:19 +0000
> +++ cmd/cmd.go 2013-10-21 18:10:36 +0000
> @@ -15,12 +15,12 @@
> "strings"
>
> "launchpad.net/gnuflag"
> -
> - "launchpad.net/juju-core/utils"
> )
>
> func init() {
> - http.DefaultTransport = utils.NewHttpTransport()
> + // Don't replace the default transport as other init blocks
> + // register protocols.
> + http.DefaultTransport.(*http.Transport).DisableKeepAlives = true
> }
>
> // ErrSilent can be returned from Run to signal that Main should exit with
>
>
>
>
>
> --
> https://code.launchpad.net/~thumper/juju-core/fix-default-http/+merge/192034
> You are subscribed to branch lp:juju-core.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/cmd.go'
2--- cmd/cmd.go 2013-10-17 22:48:19 +0000
3+++ cmd/cmd.go 2013-10-21 18:22:37 +0000
4@@ -15,12 +15,12 @@
5 "strings"
6
7 "launchpad.net/gnuflag"
8-
9- "launchpad.net/juju-core/utils"
10 )
11
12 func init() {
13- http.DefaultTransport = utils.NewHttpTransport()
14+ // Don't replace the default transport as other init blocks
15+ // register protocols.
16+ http.DefaultTransport.(*http.Transport).DisableKeepAlives = true
17 }
18
19 // ErrSilent can be returned from Run to signal that Main should exit with

Subscribers

People subscribed via source and target branches

to status/vote changes: