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-unixfs
Commits
6f8a89cd
Commit
6f8a89cd
authored
10 years ago
by
Henry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed version pkg to handshake
parent
eab1a890
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
11 deletions
+11
-11
net/handshake/Makefile
net/handshake/Makefile
+0
-0
net/handshake/semver.pb.go
net/handshake/semver.pb.go
+3
-3
net/handshake/semver.proto
net/handshake/semver.proto
+1
-1
net/handshake/version.go
net/handshake/version.go
+1
-1
net/handshake/version_test.go
net/handshake/version_test.go
+1
-1
net/swarm/conn.go
net/swarm/conn.go
+5
-5
No files found.
net/
version
/Makefile
→
net/
handshake
/Makefile
View file @
6f8a89cd
File moved
This diff is collapsed.
Click to expand it.
net/
version
/semver.pb.go
→
net/
handshake
/semver.pb.go
View file @
6f8a89cd
...
...
@@ -3,7 +3,7 @@
// DO NOT EDIT!
/*
Package
version
is a generated protocol buffer package.
Package
handshake
is a generated protocol buffer package.
It is generated from these files:
semver.proto
...
...
@@ -11,9 +11,9 @@ It is generated from these files:
It has these top-level messages:
SemVer
*/
package
version
package
handshake
import
proto
"
github.com/jbenet/go-ipfs/Godeps/_workspace/src/
code.google.com/p/gogoprotobuf/proto"
import
proto
"code.google.com/p/gogoprotobuf/proto"
import
math
"math"
// Reference imports to suppress errors if they are not otherwise used.
...
...
This diff is collapsed.
Click to expand it.
net/
version
/semver.proto
→
net/
handshake
/semver.proto
View file @
6f8a89cd
package
version
;
package
handshake
;
message
SemVer
{
optional
int64
major
=
1
;
...
...
This diff is collapsed.
Click to expand it.
net/
version
/version.go
→
net/
handshake
/version.go
View file @
6f8a89cd
package
version
package
handshake
// currentVersion holds the current protocol version for a client running this code
var
currentVersion
=
NewSemVer
(
0
,
0
,
1
)
...
...
This diff is collapsed.
Click to expand it.
net/
version
/version_test.go
→
net/
handshake
/version_test.go
View file @
6f8a89cd
package
version
package
handshake
import
"testing"
...
...
This diff is collapsed.
Click to expand it.
net/swarm/conn.go
View file @
6f8a89cd
...
...
@@ -6,8 +6,8 @@ import (
spipe
"github.com/jbenet/go-ipfs/crypto/spipe"
conn
"github.com/jbenet/go-ipfs/net/conn"
handshake
"github.com/jbenet/go-ipfs/net/handshake"
msg
"github.com/jbenet/go-ipfs/net/message"
version
"github.com/jbenet/go-ipfs/net/version"
proto
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/goprotobuf/proto"
ma
"github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
...
...
@@ -161,8 +161,8 @@ func (s *Swarm) connSecure(c *conn.Conn) error {
// connVersionExchange exchanges local and remote versions and compares them
// closes remote and returns an error in case of major difference
func
(
s
*
Swarm
)
connVersionExchange
(
remote
*
conn
.
Conn
)
error
{
var
remoteVersion
,
myVersion
*
version
.
SemVer
myVersion
=
version
.
Current
()
var
remoteVersion
,
myVersion
*
handshake
.
SemVer
myVersion
=
handshake
.
Current
()
// BUG(cryptix): do we need to use a NetMessage here?
myVersionMsg
,
err
:=
msg
.
FromObject
(
s
.
local
,
myVersion
)
...
...
@@ -202,7 +202,7 @@ func (s *Swarm) connVersionExchange(remote *conn.Conn) error {
return
fmt
.
Errorf
(
"Error retrieving from conn: %v"
,
remote
.
Peer
)
}
remoteVersion
=
new
(
version
.
SemVer
)
remoteVersion
=
new
(
handshake
.
SemVer
)
err
=
proto
.
Unmarshal
(
data
,
remoteVersion
)
if
err
!=
nil
{
s
.
Close
()
...
...
@@ -215,7 +215,7 @@ func (s *Swarm) connVersionExchange(remote *conn.Conn) error {
}
}
if
!
version
.
Compatible
(
myVersion
,
remoteVersion
)
{
if
!
handshake
.
Compatible
(
myVersion
,
remoteVersion
)
{
remote
.
Close
()
return
errors
.
New
(
"protocol missmatch"
)
}
...
...
This diff is collapsed.
Click to expand it.
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