Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-cmds
Commits
15bbfb15
Commit
15bbfb15
authored
Jul 20, 2015
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
if no context set in request, use context.TODO()
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
2b99f038
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
http/client.go
http/client.go
+10
-0
No files found.
http/client.go
View file @
15bbfb15
...
...
@@ -13,6 +13,8 @@ import (
cmds
"github.com/ipfs/go-ipfs/commands"
config
"github.com/ipfs/go-ipfs/repo/config"
context
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
)
const
(
...
...
@@ -35,6 +37,14 @@ func NewClient(address string) Client {
func
(
c
*
client
)
Send
(
req
cmds
.
Request
)
(
cmds
.
Response
,
error
)
{
if
req
.
Context
()
==
nil
{
log
.
Warningf
(
"no context set in request"
)
err
:=
req
.
SetRootContext
(
context
.
TODO
())
if
err
!=
nil
{
return
nil
,
err
}
}
// save user-provided encoding
previousUserProvidedEncoding
,
found
,
err
:=
req
.
Option
(
cmds
.
EncShort
)
.
String
()
if
err
!=
nil
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment