mirror of
https://github.com/lxsang/ant-http
synced 2025-02-23 16:42:48 +01:00
TODO: remove extern variable
This commit is contained in:
parent
90d44d782f
commit
d50b1352f6
@ -134,6 +134,7 @@ int antd_close(void* src)
|
|||||||
//printf("Close sock %d\n", source->sock);
|
//printf("Close sock %d\n", source->sock);
|
||||||
int ret = close(source->sock);
|
int ret = close(source->sock);
|
||||||
if(source->ip) free(source->ip);
|
if(source->ip) free(source->ip);
|
||||||
|
// TODO remove this when using nonblocking
|
||||||
server_config.connection--;
|
server_config.connection--;
|
||||||
LOG("Remaining connection %d\n", server_config.connection);
|
LOG("Remaining connection %d\n", server_config.connection);
|
||||||
free(src);
|
free(src);
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
plugin_header __plugin__;
|
plugin_header __plugin__;
|
||||||
// private function
|
// private function
|
||||||
call __init__;
|
|
||||||
void __init_plugin__(const char* pl,config_t* conf){
|
void __init_plugin__(const char* pl,config_t* conf){
|
||||||
__plugin__.name = strdup(pl);
|
__plugin__.name = strdup(pl);
|
||||||
__plugin__.dbpath= strdup(conf->db_path);
|
__plugin__.dbpath= strdup(conf->db_path);
|
||||||
@ -12,7 +11,7 @@ void __init_plugin__(const char* pl,config_t* conf){
|
|||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
__plugin__.usessl = conf->usessl;
|
__plugin__.usessl = conf->usessl;
|
||||||
#endif
|
#endif
|
||||||
if(__init__ != NULL) __init__();
|
init();
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_DB
|
#ifdef USE_DB
|
||||||
|
@ -19,12 +19,21 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
typedef void(*call)();
|
//typedef void(*call)();
|
||||||
#ifdef USE_DB
|
#ifdef USE_DB
|
||||||
typedef sqlite3* sqldb;
|
typedef sqlite3* sqldb;
|
||||||
#endif
|
#endif
|
||||||
|
/*
|
||||||
|
Two server,
|
||||||
|
Two configuration different
|
||||||
|
Does it work
|
||||||
|
Replace this by a accessing function
|
||||||
|
that execute the set value to
|
||||||
|
the header, instead of
|
||||||
|
exporting global variables
|
||||||
|
*/
|
||||||
extern plugin_header __plugin__;
|
extern plugin_header __plugin__;
|
||||||
extern call __init__;
|
//extern call __init__;
|
||||||
|
|
||||||
|
|
||||||
#ifdef USE_DB
|
#ifdef USE_DB
|
||||||
@ -36,6 +45,8 @@ char* route(const char*);
|
|||||||
char* htdocs(const char*);
|
char* htdocs(const char*);
|
||||||
char* config_dir();
|
char* config_dir();
|
||||||
/*Default function for plugin*/
|
/*Default function for plugin*/
|
||||||
|
// init the plugin
|
||||||
|
void init();
|
||||||
void handle(void*, const char*,const char*,dictionary);
|
void handle(void*, const char*,const char*,dictionary);
|
||||||
void __release();
|
void __release();
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user