Skip to content

Commit

Permalink
delete shortlink index
Browse files Browse the repository at this point in the history
  • Loading branch information
garryyan committed May 25, 2017
1 parent c83ff6b commit 3270f44
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions mars/stn/src/shortlink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace stn{

class ShortLinkConnectObserver : public MComplexConnect {
public:
ShortLinkConnectObserver(ShortLink& _shortlink): shortlink_(_shortlink), index_(-1), rtt_(0), last_err_(-1) {
ShortLinkConnectObserver(ShortLink& _shortlink): shortlink_(_shortlink), rtt_(0), last_err_(-1) {
memset(ConnectingIndex, 0, sizeof(ConnectingIndex));
};

Expand All @@ -68,10 +68,7 @@ class ShortLinkConnectObserver : public MComplexConnect {
virtual void OnConnected(unsigned int _index, const socket_address& _addr, SOCKET _socket, int _error, int _rtt) {
ConnectingIndex[_index] = 0;

if (0 == _error) {
xassert2(-1 == index_, "index_:%d", index_);
index_ = _index;
} else {
if (0 != _error) {
xassert2(shortlink_.func_network_report);

if (_index < shortlink_.Profile().ip_items.size())
Expand All @@ -84,7 +81,6 @@ class ShortLinkConnectObserver : public MComplexConnect {
}
}

int Index() const {return index_;}
int LastErrorCode() const {return last_err_;}
int Rtt() const {return rtt_;}

Expand All @@ -96,7 +92,6 @@ class ShortLinkConnectObserver : public MComplexConnect {

private:
ShortLink& shortlink_;
int index_;
int rtt_;
int last_err_;
};
Expand Down

0 comments on commit 3270f44

Please sign in to comment.