From 27ea6eb99e45109ec29e11a1990302bb0c587d6e Mon Sep 17 00:00:00 2001 From: yumoqing Date: Mon, 18 Dec 2023 22:15:24 +0800 Subject: [PATCH] bugfix --- ahserver/baseProcessor.py | 1 + ahserver/processorResource.py | 8 +------- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index 13c968b..1d2a882 100755 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -13,6 +13,7 @@ from appPublic.app_logger import AppLogger from .utils import unicode_escape from .serverenv import ServerEnv +from .filetest import current_fileno class ObjectCache: def __init__(self): diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index c9aa0c3..1c0e6d3 100755 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -229,7 +229,6 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): async def get_user(): return await auth.get_auth(request) - f_cnt1 = current_fileno() self.y_env.i18n = serveri18n self.y_env.file_realpath = file_realpath self.y_env.redirect = redirect @@ -255,7 +254,6 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): request['request_filename'] = self.request_filename path = request.path config = getConfig() - f_cnt2 = current_fileno() request['port'] = config.website.port if config.website.dbadm and path.startswith(config.website.dbadm): pp = path.split('/')[2:] @@ -267,7 +265,6 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): action = pp[2] adm = DBAdmin(request,dbname,tablename,action) return await adm.render() - f_cnt3 = current_fileno() if config.website.dbrest and path.startswith(config.website.dbrest): pp = path.split('/')[2:] if len(pp)<2: @@ -280,7 +277,6 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): id = pp[2] crud = DBCrud(request,dbname,tablename,id=id) return await crud.dispatch() - f_cnt4 = current_fileno() if config.website.download and path.startswith(config.website.download): pp = path.split('/')[2:] if len(pp)<1: @@ -290,13 +286,10 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): path = path_decode(dp) return await file_download(request, path) - f_cnt5 = current_fileno() # processor = self.url2processor(request, str(request.url)) processor = self.url2processor(request, str(request.url), self.request_filename) if processor: ret = await processor.handle(request) - f_cnt6 = current_fileno() - print(f'{f_cnt1=}, {f_cnt2=}, {f_cnt3=}, {f_cnt4=}, {f_cnt5=}, {f_cnt6=}') return ret f_cnt6 = current_fileno() @@ -368,6 +361,7 @@ class ProcessorResource(AppLogger, StaticResource,Url2File): Klass = getProcessor(handlername) try: processor = Klass(path,self) + # print(f'{f_cnt1=}, {f_cnt2=}, {f_cnt3=}, {f_cnt4=}, {f_cnt5=}') return processor except Exception as e: print('Exception:',e, 'handlername=', handlername)