Skip to content

Commit

Permalink
Fixed a locking error in the communications.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikhil Samith Bysani committed Jan 18, 2009
1 parent 1c3bf8f commit a14760c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/base/bang-com.c
Expand Up @@ -624,13 +624,15 @@ void BANG_request_peer_id(int peer_id, BANG_request request) {
}

int BANG_get_key_with_peer_id(int peer_id) {
acquire_peers_read_lock();
unsigned int i = 0;
for (i = 0; i < current_peers; ++i) {
if (peers[i]->peer_id == peer_id) {
release_peers_read_lock();
return i;
}
}

release_peers_read_lock();
return -1;
}

Expand Down

0 comments on commit a14760c

Please sign in to comment.