Addition of the service, server, serv_protocol and session structure needed to tie the elements together.
Improvements to the protocol module support Documentation improvements Addition of make install target
This commit is contained in:
@ -28,8 +28,9 @@ READCONOBJ=$(READCONSRCS:.c=.o)
|
||||
SRCS=$(TESTSRCS) $(READCONSRCS)
|
||||
OBJ=$(SRCS:.c=.o)
|
||||
LIBS=-lssl
|
||||
MODULES=libtestroute.so libreadconnroute.so
|
||||
|
||||
all: libtestroute.so libreadconnroute.so
|
||||
all: $(MODULES)
|
||||
|
||||
libtestroute.so: $(TESTOBJ)
|
||||
$(CC) $(LDFLAGS) $(TESTOBJ) $(LIBS) -o $@
|
||||
@ -52,4 +53,7 @@ depend.mk: $(SRCS)
|
||||
@rm -f depend.mk
|
||||
cc -M $(CFLAGS) $(SRCS) > depend.mk
|
||||
|
||||
install: $(MODULES)
|
||||
install -D $< $(DEST)/gateway/modules
|
||||
|
||||
include depend.mk
|
||||
|
@ -6,8 +6,14 @@ testroute.o: testroute.c /usr/include/stdio.h /usr/include/features.h \
|
||||
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
|
||||
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include/stdarg.h \
|
||||
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
|
||||
../../include/router.h ../../include/service.h ../../include/session.h \
|
||||
../../include/buffer.h
|
||||
../../include/router.h ../../include/service.h /usr/include/time.h \
|
||||
/usr/include/bits/time.h /usr/include/xlocale.h ../../include/spinlock.h \
|
||||
../../include/thread.h /usr/include/pthread.h /usr/include/endian.h \
|
||||
/usr/include/bits/endian.h /usr/include/bits/byteswap.h \
|
||||
/usr/include/sched.h /usr/include/bits/sched.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/bits/setjmp.h \
|
||||
../../include/dcb.h ../../include/buffer.h ../../include/server.h \
|
||||
../../include/session.h
|
||||
readconnroute.o: readconnroute.c /usr/include/stdio.h \
|
||||
/usr/include/features.h /usr/include/sys/cdefs.h \
|
||||
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
|
||||
@ -25,8 +31,8 @@ readconnroute.o: readconnroute.c /usr/include/stdio.h \
|
||||
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
|
||||
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
|
||||
/usr/include/string.h /usr/include/xlocale.h ../../include/service.h \
|
||||
../../include/spinlock.h ../../include/thread.h /usr/include/pthread.h \
|
||||
/usr/include/sched.h /usr/include/bits/sched.h \
|
||||
/usr/include/bits/setjmp.h ../../include/dcb.h ../../include/buffer.h \
|
||||
../../include/server.h ../../include/router.h ../../include/session.h \
|
||||
../../include/buffer.h ../../include/atomic.h ../../include/spinlock.h \
|
||||
../../include/thread.h /usr/include/pthread.h /usr/include/sched.h \
|
||||
/usr/include/bits/sched.h /usr/include/bits/setjmp.h \
|
||||
../include/readconnection.h ../../include/dcb.h
|
||||
../../include/atomic.h ../include/readconnection.h
|
||||
|
@ -127,7 +127,7 @@ int i, n;
|
||||
* that we can maintain a count of the number of connections to each
|
||||
* backend server.
|
||||
*/
|
||||
for (server = service->databases, n = 0; server; server = server->next)
|
||||
for (server = service->databases, n = 0; server; server = server->nextdb)
|
||||
n++;
|
||||
|
||||
inst->servers = (BACKEND **)calloc(n, sizeof(BACKEND *));
|
||||
@ -137,7 +137,7 @@ int i, n;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (server = service->databases, n = 0; server; server = server->next)
|
||||
for (server = service->databases, n = 0; server; server = server->nextdb)
|
||||
{
|
||||
if ((inst->servers[n] = malloc(sizeof(BACKEND))) == NULL)
|
||||
{
|
||||
@ -224,8 +224,8 @@ int i;
|
||||
* Close a session with the router, this is the mechanism
|
||||
* by which a router may cleanup data structure etc.
|
||||
*
|
||||
* @param instance The router instance data
|
||||
* @param session The session being closed
|
||||
* @param instance The router instance data
|
||||
* @param router_session The session being closed
|
||||
*/
|
||||
static void
|
||||
closeSession(ROUTER *instance, void *router_session)
|
||||
@ -265,9 +265,10 @@ CLIENT_SESSION *session = (CLIENT_SESSION *)router_session;
|
||||
* This is simply a case of sending it to the connection that was
|
||||
* chosen when we started the client session.
|
||||
*
|
||||
* @param instance The router instance
|
||||
* @param session The router session returned from the newSession call
|
||||
* @param queue The queue of data buffers to route
|
||||
* @param instance The router instance
|
||||
* @param router_session The router session returned from the newSession call
|
||||
* @param queue The queue of data buffers to route
|
||||
* @return The number of bytes sent
|
||||
*/
|
||||
static int
|
||||
routeQuery(ROUTER *instance, void *router_session, GWBUF *queue)
|
||||
|
Reference in New Issue
Block a user