mirror of
https://github.com/openshwprojects/OpenBK7231T_App.git
synced 2026-02-09 07:35:42 +00:00
initialise g_commands
debug in exec. fix a logging bug. add commands: logtype direct|all, logdelay <ms>
This commit is contained in:
@ -409,9 +409,9 @@ int HTTP_ProcessPacket(http_request_t *request) {
|
||||
}
|
||||
|
||||
if (request->method == HTTP_GET) {
|
||||
ADDLOG_INFO(LOG_FEATURE_HTTP, "HTTP request\n");
|
||||
//ADDLOG_INFO(LOG_FEATURE_HTTP, "HTTP request\n");
|
||||
} else {
|
||||
ADDLOG_INFO(LOG_FEATURE_HTTP, "Other request\n");
|
||||
//ADDLOG_INFO(LOG_FEATURE_HTTP, "Other request\n");
|
||||
}
|
||||
|
||||
// if OPTIONS, return now - for CORS
|
||||
|
||||
@ -284,16 +284,17 @@ static int http_rest_get_lfs_file(http_request_t *request){
|
||||
file = os_malloc(sizeof(lfs_file_t));
|
||||
memset(file, 0, sizeof(lfs_file_t));
|
||||
|
||||
strncpy(fpath, request->url + strlen("api/lfs/"), 63);
|
||||
strcpy(fpath, request->url + strlen("api/lfs/"));
|
||||
|
||||
ADDLOG_DEBUG(LOG_FEATURE_API, "LFS read of %s", fpath);
|
||||
lfsres = lfs_file_open(&lfs, file, fpath, LFS_O_RDONLY);
|
||||
|
||||
if (lfsres == -21){
|
||||
lfs_dir_t *dir;
|
||||
ADDLOG_DEBUG(LOG_FEATURE_API, "%s is a folder", fpath);
|
||||
dir = os_malloc(sizeof(lfs_dir_t));
|
||||
os_memset(dir, 0, sizeof(*dir));
|
||||
// if the thing is a folder.
|
||||
ADDLOG_DEBUG(LOG_FEATURE_API, "%s is a folder", fpath);
|
||||
lfsres = lfs_dir_open(&lfs, dir, fpath);
|
||||
|
||||
if (lfsres >= 0){
|
||||
@ -337,6 +338,7 @@ static int http_rest_get_lfs_file(http_request_t *request){
|
||||
hprintf128(request, "{\"fname\":\"%s\",\"error\":%d}", fpath, lfsres);
|
||||
}
|
||||
} else {
|
||||
ADDLOG_DEBUG(LOG_FEATURE_API, "LFS open [%s] gives %d", fpath, lfsres);
|
||||
if (lfsres >= 0){
|
||||
const char *mimetype = httpMimeTypeBinary;
|
||||
do {
|
||||
|
||||
Reference in New Issue
Block a user