Clean up some compiler warnings
This commit is contained in:
@ -311,7 +311,7 @@ DOWNSTREAM *me;
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
me->instance = filter->filter;
|
me->instance = filter->filter;
|
||||||
me->routeQuery = filter->obj->routeQuery;
|
me->routeQuery = (void *)(filter->obj->routeQuery);
|
||||||
me->session = filter->obj->newSession(me->instance, session);
|
me->session = filter->obj->newSession(me->instance, session);
|
||||||
|
|
||||||
filter->obj->setDownstream(me->instance, me->session, downstream);
|
filter->obj->setDownstream(me->instance, me->session, downstream);
|
||||||
|
@ -52,6 +52,7 @@
|
|||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <mysql.h>
|
#include <mysql.h>
|
||||||
#include <monitor.h>
|
#include <monitor.h>
|
||||||
#include <version.h>
|
#include <version.h>
|
||||||
|
@ -130,6 +130,7 @@ setipaddress(struct in_addr *a, char *p) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -650,12 +650,23 @@ FILTER_DEF **flist;
|
|||||||
char *ptr, *brkt;
|
char *ptr, *brkt;
|
||||||
int n = 0;
|
int n = 0;
|
||||||
|
|
||||||
flist = (FILTER_DEF *)malloc(sizeof(FILTER_DEF *));
|
if ((flist = (FILTER_DEF **)malloc(sizeof(FILTER_DEF *))) == NULL)
|
||||||
|
{
|
||||||
|
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
||||||
|
"Out of memory adding filters to service.\n")));
|
||||||
|
return;
|
||||||
|
}
|
||||||
ptr = strtok_r(filters, "|", &brkt);
|
ptr = strtok_r(filters, "|", &brkt);
|
||||||
while (ptr)
|
while (ptr)
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
flist = (FILTER_DEF *)realloc(flist, (n + 1) * sizeof(FILTER_DEF *));
|
if ((flist = (FILTER_DEF **)realloc(flist,
|
||||||
|
(n + 1) * sizeof(FILTER_DEF *))) == NULL)
|
||||||
|
{
|
||||||
|
LOGIF(LE, (skygw_log_write_flush(LOGFILE_ERROR,
|
||||||
|
"Out of memory adding filters to service.\n")));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if ((flist[n-1] = filter_find(trim(ptr))) == NULL)
|
if ((flist[n-1] = filter_find(trim(ptr))) == NULL)
|
||||||
{
|
{
|
||||||
LOGIF(LE, (skygw_log_write_flush(
|
LOGIF(LE, (skygw_log_write_flush(
|
||||||
|
@ -165,7 +165,7 @@ session_alloc(SERVICE *service, DCB *client_dcb)
|
|||||||
session->head.instance = service->router_instance;
|
session->head.instance = service->router_instance;
|
||||||
session->head.session = session->router_session;
|
session->head.session = session->router_session;
|
||||||
|
|
||||||
session->head.routeQuery = service->router->routeQuery;
|
session->head.routeQuery = (void *)(service->router->routeQuery);
|
||||||
|
|
||||||
if (service->n_filters > 0)
|
if (service->n_filters > 0)
|
||||||
{
|
{
|
||||||
|
@ -209,7 +209,7 @@ typedef struct dcb {
|
|||||||
struct session *session; /**< The owning session */
|
struct session *session; /**< The owning session */
|
||||||
GWPROTOCOL func; /**< The functions for this descriptor */
|
GWPROTOCOL func; /**< The functions for this descriptor */
|
||||||
|
|
||||||
unsigned int writeqlen; /**< Current number of byes in the write queue */
|
int writeqlen; /**< Current number of byes in the write queue */
|
||||||
SPINLOCK writeqlock; /**< Write Queue spinlock */
|
SPINLOCK writeqlock; /**< Write Queue spinlock */
|
||||||
GWBUF *writeq; /**< Write Data Queue */
|
GWBUF *writeq; /**< Write Data Queue */
|
||||||
SPINLOCK delayqlock; /**< Delay Backend Write Queue spinlock */
|
SPINLOCK delayqlock; /**< Delay Backend Write Queue spinlock */
|
||||||
|
@ -155,6 +155,7 @@ extern int serviceStop(SERVICE *);
|
|||||||
extern int serviceRestart(SERVICE *);
|
extern int serviceRestart(SERVICE *);
|
||||||
extern int serviceSetUser(SERVICE *, char *, char *);
|
extern int serviceSetUser(SERVICE *, char *, char *);
|
||||||
extern int serviceGetUser(SERVICE *, char **, char **);
|
extern int serviceGetUser(SERVICE *, char **, char **);
|
||||||
|
extern void serviceSetFilters(SERVICE *, char *);
|
||||||
extern int serviceEnableRootUser(SERVICE *, int );
|
extern int serviceEnableRootUser(SERVICE *, int );
|
||||||
extern void service_update(SERVICE *, char *, char *, char *);
|
extern void service_update(SERVICE *, char *, char *, char *);
|
||||||
extern int service_refresh_users(SERVICE *);
|
extern int service_refresh_users(SERVICE *);
|
||||||
|
Reference in New Issue
Block a user