X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=lib%2Fpeer.c;h=0a1d2ec42d7b69b93582ebcbf0f7b8dbe1a341c1;hb=5c60297a1eaab7b10d6f584ba329493a41b812d0;hp=4fbb54f1c4bc48970ae6a3e6d9de90eb4db7c8a4;hpb=7636505962a348d9564e53922834dc6df1274653;p=radsecproxy.git diff --git a/lib/peer.c b/lib/peer.c index 4fbb54f..0a1d2ec 100644 --- a/lib/peer.c +++ b/lib/peer.c @@ -1,4 +1,6 @@ -/* See the file COPYING for licensing information. */ +/* Copyright 2010, 2011 NORDUnet A/S. All rights reserved. + See the file COPYING for licensing information. */ + #if defined HAVE_CONFIG_H #include #endif @@ -6,7 +8,22 @@ #include #include #include +#include "peer.h" + +struct rs_peer * +peer_pick_peer (struct rs_connection *conn) +{ + assert (conn); + + if (conn->active_peer) + conn->active_peer = conn->active_peer->next; /* Next. */ + if (!conn->active_peer) + conn->active_peer = conn->peers; /* From the top. */ + + return conn->active_peer; +} +/* Public functions. */ int rs_peer_create (struct rs_connection *conn, struct rs_peer **peer_out) {