[CLEANUP] peers.h: fix declarations

* The declaration of peer_session_create() does
  not match its definition. As it is only
  used inside of peers.c make it static.

* Make the declaration of peers_register_table()
  match its definition.

* Also, make all functions in peers.c that
  are not also in peers.h static
This commit is contained in:
Simon Horman 2011-06-08 09:18:51 +09:00 committed by Willy Tarreau
parent 70735c98f7
commit 96553775a0
2 changed files with 7 additions and 8 deletions

View File

@ -28,8 +28,7 @@
#include <types/session.h> #include <types/session.h>
#include <types/peers.h> #include <types/peers.h>
struct session * peer_session_create(struct peer *); void peers_register_table(struct peers *, struct stktable *table);
struct session * peers_register_table(struct peers *, struct stktable *table);
int peer_accept(struct session *); int peer_accept(struct session *);

View File

@ -125,14 +125,14 @@
#define PEER_SESSION_PROTO_NAME "HAProxyS" #define PEER_SESSION_PROTO_NAME "HAProxyS"
struct peers *peers = NULL; struct peers *peers = NULL;
void peer_session_forceshutdown(struct session * session); static void peer_session_forceshutdown(struct session * session);
/* /*
* This prepare the data update message of the stick session <ts>, <ps> is the the peer session * This prepare the data update message of the stick session <ts>, <ps> is the the peer session
* where the data going to be pushed, <msg> is a buffer of <size> to recieve data message content * where the data going to be pushed, <msg> is a buffer of <size> to recieve data message content
*/ */
int peer_prepare_datamsg(struct stksess *ts, struct peer_session *ps, char *msg, size_t size) static int peer_prepare_datamsg(struct stksess *ts, struct peer_session *ps, char *msg, size_t size)
{ {
uint32_t netinteger; uint32_t netinteger;
int len; int len;
@ -182,7 +182,7 @@ int peer_prepare_datamsg(struct stksess *ts, struct peer_session *ps, char *msg,
/* /*
* Callback to release a session with a peer * Callback to release a session with a peer
*/ */
void peer_session_release(struct stream_interface *si) static void peer_session_release(struct stream_interface *si)
{ {
struct task *t= (struct task *)si->owner; struct task *t= (struct task *)si->owner;
struct session *s = (struct session *)t->context; struct session *s = (struct session *)t->context;
@ -1049,7 +1049,7 @@ static struct si_applet peer_applet = {
/* /*
* Use this function to force a close of a peer session * Use this function to force a close of a peer session
*/ */
void peer_session_forceshutdown(struct session * session) static void peer_session_forceshutdown(struct session * session)
{ {
struct stream_interface *oldsi; struct stream_interface *oldsi;
@ -1104,7 +1104,7 @@ int peer_accept(struct session *s)
/* /*
* Create a new peer session in assigned state (connect will start automatically) * Create a new peer session in assigned state (connect will start automatically)
*/ */
struct session *peer_session_create(struct peer *peer, struct peer_session *ps) static struct session *peer_session_create(struct peer *peer, struct peer_session *ps)
{ {
struct listener *l = ((struct proxy *)peer->peers->peers_fe)->listen; struct listener *l = ((struct proxy *)peer->peers->peers_fe)->listen;
struct proxy *p = (struct proxy *)l->frontend; /* attached frontend */ struct proxy *p = (struct proxy *)l->frontend; /* attached frontend */
@ -1294,7 +1294,7 @@ struct session *peer_session_create(struct peer *peer, struct peer_session *ps)
* Task processing function to manage re-connect and peer session * Task processing function to manage re-connect and peer session
* tasks wakeup on local update. * tasks wakeup on local update.
*/ */
struct task *process_peer_sync(struct task * task) static struct task *process_peer_sync(struct task * task)
{ {
struct shared_table *st = (struct shared_table *)task->context; struct shared_table *st = (struct shared_table *)task->context;
struct peer_session *ps; struct peer_session *ps;