Commit 6f8a89cd authored by Henry's avatar Henry

renamed version pkg to handshake

parent eab1a890
File moved
......@@ -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.
......
package version;
package handshake;
message SemVer {
optional int64 major = 1;
......
package version
package handshake
// currentVersion holds the current protocol version for a client running this code
var currentVersion = NewSemVer(0, 0, 1)
......
package version
package handshake
import "testing"
......
......@@ -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")
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment