// client did not pass token on URI let's use cookies
if ((!request->restfull) && (request->context != NULL)) {
char cookie[64];
// client did not pass token on URI let's use cookies
if ((!request->restfull) && (request->context != NULL)) {
char cookie[64];
- snprintf (cookie, sizeof (cookie), "%s=%s", COOKIE_NAME, request->uuid);
+ snprintf (cookie, sizeof (cookie), "%s=%s;path=/api;max-age=%d", COOKIE_NAME, request->uuid, request->config->cntxTimeout);
STATIC void scanDirectory(char *dirpath, int dirfd, AFB_plugin **plugins, int *count) {
DIR *dir;
void *libso;
STATIC void scanDirectory(char *dirpath, int dirfd, AFB_plugin **plugins, int *count) {
DIR *dir;
void *libso;
- if ((pluginDir->d_type == DT_DIR) && (pluginDir->d_name[0] != '.')) {
- int fd = openat (dirfd, pluginDir->d_name, O_DIRECTORY);
+ if ((pluginDir.d_type == DT_DIR) && (pluginDir.d_name[0] != '.')) {
+ int fd = openat (dirfd, pluginDir.d_name, O_DIRECTORY);
char newpath[255];
strncpy (newpath, dirpath, sizeof(newpath));
strncat (newpath, "/", sizeof(newpath));
char newpath[255];
strncpy (newpath, dirpath, sizeof(newpath));
strncat (newpath, "/", sizeof(newpath));
scanDirectory (newpath, fd, plugins, count);
close (fd);
scanDirectory (newpath, fd, plugins, count);
close (fd);
- snprintf (pluginPath, sizeof(pluginPath), "%s/%s", dirpath, pluginDir->d_name);
+ snprintf (pluginPath, sizeof(pluginPath), "%s/%s", dirpath, pluginDir.d_name);
libso = dlopen (pluginPath, RTLD_NOW | RTLD_LOCAL);
// Load fail we ignore this .so file
if (!libso) {
libso = dlopen (pluginPath, RTLD_NOW | RTLD_LOCAL);
// Load fail we ignore this .so file
if (!libso) {
- fprintf(stderr, "[%s] is not loadable, continuing...\n", pluginDir->d_name);
+ fprintf(stderr, "[%s] is not loadable, continuing...\n", pluginDir.d_name);
- fprintf(stderr, "[%s] is not an AFB plugin, continuing...\n", pluginDir->d_name);
+ fprintf(stderr, "[%s] is not an AFB plugin, continuing...\n", pluginDir.d_name);
- if (verbose) fprintf(stderr, "[%s] is a valid AFB plugin, loading pos[%d]\n", pluginDir->d_name, *count);
+ if (verbose) fprintf(stderr, "[%s] is a valid AFB plugin, loading pos[%d]\n", pluginDir.d_name, *count);
plugins[*count] = (AFB_plugin *) malloc (sizeof(AFB_plugin));
plugins[*count] = (**pluginRegisterFct)();
*count = *count +1;
plugins[*count] = (AFB_plugin *) malloc (sizeof(AFB_plugin));
plugins[*count] = (**pluginRegisterFct)();
*count = *count +1;