Changed readconnroute backend structure to simply maintain a pointer to the server rather than
include the hostname and port in the backend structure Fix to makefile for routing modules
This commit is contained in:
@ -33,12 +33,11 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal structure used to define the set of backend servers we are routing
|
* Internal structure used to define the set of backend servers we are routing
|
||||||
* connections to.
|
* connections to. This provides the storage for routing module specific data
|
||||||
|
* that is required for each of the backend servers.
|
||||||
*/
|
*/
|
||||||
typedef struct backend {
|
typedef struct backend {
|
||||||
char *hostname; /**< Server hostname */
|
SERVER *server; /**< The server itself */
|
||||||
unsigned short port; /**< Port on which the server listens */
|
|
||||||
char *protocol; /**< Protocol to use to connect to the server */
|
|
||||||
int count; /**< Number of connections to the server */
|
int count; /**< Number of connections to the server */
|
||||||
} BACKEND;
|
} BACKEND;
|
||||||
|
|
||||||
|
@ -25,9 +25,9 @@ TESTSRCS=testroute.c
|
|||||||
TESTOBJ=$(TESTSRCS:.c=.o)
|
TESTOBJ=$(TESTSRCS:.c=.o)
|
||||||
READCONSRCS=readconnroute.c
|
READCONSRCS=readconnroute.c
|
||||||
READCONOBJ=$(READCONSRCS:.c=.o)
|
READCONOBJ=$(READCONSRCS:.c=.o)
|
||||||
DEBUGSRCS=debugcli.c
|
DEBUGCLISRCS=debugcli.c
|
||||||
DEBUGCLIOBJ=$(DEBUGSRCS:.c=.o)
|
DEBUGCLIOBJ=$(DEBUGCLISRCS:.c=.o)
|
||||||
SRCS=$(TESTSRCS) $(READCONSRCS) $(DEBUGCLIOBJ)
|
SRCS=$(TESTSRCS) $(READCONSRCS) $(DEBUGCLISRCS)
|
||||||
OBJ=$(SRCS:.c=.o)
|
OBJ=$(SRCS:.c=.o)
|
||||||
LIBS=-lssl
|
LIBS=-lssl
|
||||||
MODULES=libtestroute.so libreadconnroute.so libdebugcli.so
|
MODULES=libtestroute.so libreadconnroute.so libdebugcli.so
|
||||||
|
@ -147,9 +147,7 @@ int i, n;
|
|||||||
free(inst);
|
free(inst);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
inst->servers[n]->hostname = strdup(server->name);
|
inst->servers[n]->server = server;
|
||||||
inst->servers[n]->protocol = strdup(server->protocol);
|
|
||||||
inst->servers[n]->port = server->port;
|
|
||||||
inst->servers[n]->count = 0;
|
inst->servers[n]->count = 0;
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user