mirror of
https://github.com/lxsang/ant-http
synced 2024-11-18 01:08:21 +01:00
fix database handle
This commit is contained in:
parent
73adf50d41
commit
fb43aac923
@ -62,7 +62,7 @@ void accept_request(int client)
|
|||||||
}
|
}
|
||||||
sprintf(path, server_config.htdocs);
|
sprintf(path, server_config.htdocs);
|
||||||
strcat(path, url);
|
strcat(path, url);
|
||||||
//printf("path is : %s \n", path);
|
LOG("Path is : %s \n", path);
|
||||||
//if (path[strlen(path) - 1] == '/')
|
//if (path[strlen(path) - 1] == '/')
|
||||||
// strcat(path, "index.html");
|
// strcat(path, "index.html");
|
||||||
if (stat(path, &st) == -1) {
|
if (stat(path, &st) == -1) {
|
||||||
|
@ -19,8 +19,9 @@ sqldb __getdb(char *name)
|
|||||||
int plen = strlen(name)+strlen(__plugin__.dbpath)+4;
|
int plen = strlen(name)+strlen(__plugin__.dbpath)+4;
|
||||||
char* path = (char*) malloc(plen*sizeof(char));
|
char* path = (char*) malloc(plen*sizeof(char));
|
||||||
strcpy(path,__plugin__.dbpath);
|
strcpy(path,__plugin__.dbpath);
|
||||||
strcat(path,__plugin__.name);
|
strcat(path,name);
|
||||||
strcat(path,".db");
|
strcat(path,".db");
|
||||||
|
LOG("data base: %s\n", path);
|
||||||
sqldb ret = (sqldb)database(path);
|
sqldb ret = (sqldb)database(path);
|
||||||
free(path);
|
free(path);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user