29 #include <dlfcn.h> |
29 #include <dlfcn.h> |
30 #include <cx/string.h> |
30 #include <cx/string.h> |
31 |
31 |
32 #include "../daemon/func.h" |
32 #include "../daemon/func.h" |
33 #include "../daemon/log.h" |
33 #include "../daemon/log.h" |
|
34 #include "../daemon/config.h" |
34 |
35 |
35 #include "init.h" |
36 #include "init.h" |
36 |
37 |
37 int init_test(pblock *pb, Session *sn, Request *rq) { |
38 int init_test(pblock *pb, Session *sn, Request *rq) { |
38 printf("init-test\n"); |
39 printf("init-test\n"); |
70 |
71 |
71 return REQ_ABORTED; |
72 return REQ_ABORTED; |
72 } |
73 } |
73 |
74 |
74 // load function symbols |
75 // load function symbols |
|
76 pool_handle_t *init_pool = cfg_get_init_pool(); |
75 int b = 0; |
77 int b = 0; |
76 for(int i=0;;i++) { |
78 for(int i=0;;i++) { |
77 if(funcs[i] == '-') { |
79 if(funcs[i] == '-') { |
78 funcs[i] = '_'; |
80 funcs[i] = '_'; |
79 } |
81 } |
80 if(funcs[i] == ',' || funcs[i] == 0) { |
82 if(funcs[i] == ',' || funcs[i] == 0) { |
81 if(funcs[i] == 0) { |
83 if(funcs[i] == 0) { |
82 b = 1; |
84 b = 1; |
83 } |
85 } |
84 |
86 |
|
87 // TODO: although this works fine, is not really clean to just |
|
88 // destroy the string with random 0-bytes |
|
89 // maybe use cxstr here |
85 funcs[i] = 0; |
90 funcs[i] = 0; |
86 |
91 |
87 // we have a function name |
92 // we have a function name |
88 void *sym = dlsym(lib, funcs); |
93 void *sym = dlsym(lib, funcs); |
89 if(sym == NULL) { |
94 if(sym == NULL) { |