mirror of
https://github.com/lxsang/ant-http
synced 2024-11-17 17:08:20 +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);
|
||||
strcat(path, url);
|
||||
//printf("path is : %s \n", path);
|
||||
LOG("Path is : %s \n", path);
|
||||
//if (path[strlen(path) - 1] == '/')
|
||||
// strcat(path, "index.html");
|
||||
if (stat(path, &st) == -1) {
|
||||
|
@ -19,8 +19,9 @@ sqldb __getdb(char *name)
|
||||
int plen = strlen(name)+strlen(__plugin__.dbpath)+4;
|
||||
char* path = (char*) malloc(plen*sizeof(char));
|
||||
strcpy(path,__plugin__.dbpath);
|
||||
strcat(path,__plugin__.name);
|
||||
strcat(path,name);
|
||||
strcat(path,".db");
|
||||
LOG("data base: %s\n", path);
|
||||
sqldb ret = (sqldb)database(path);
|
||||
free(path);
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user