web: fix query handle leak
IndexResource and IncompleteURLRedirectResource handlers opened a BerkeleyDB query handle but never called query.close(), leaking file descriptors on every redirect request. Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
This commit is contained in:
parent
453580252b
commit
a54519731f
1 changed files with 2 additions and 0 deletions
|
|
@ -210,6 +210,7 @@ class IndexResource:
|
||||||
status=falcon.HTTP_INTERNAL_SERVER_ERROR)
|
status=falcon.HTTP_INTERNAL_SERVER_ERROR)
|
||||||
|
|
||||||
version = query.get_latest_tag(rc=False)
|
version = query.get_latest_tag(rc=False)
|
||||||
|
query.close()
|
||||||
resp.status = falcon.HTTP_FOUND
|
resp.status = falcon.HTTP_FOUND
|
||||||
resp.location = stringify_source_path(project, version, '/')
|
resp.location = stringify_source_path(project, version, '/')
|
||||||
return
|
return
|
||||||
|
|
@ -366,6 +367,7 @@ class IncompleteURLRedirectResource:
|
||||||
rc = version == 'latest-rc'
|
rc = version == 'latest-rc'
|
||||||
version = query.get_latest_tag(rc=rc)
|
version = query.get_latest_tag(rc=rc)
|
||||||
|
|
||||||
|
query.close()
|
||||||
resp.status = falcon.HTTP_FOUND
|
resp.status = falcon.HTTP_FOUND
|
||||||
resp.location = stringify_source_path(project, version, '/')
|
resp.location = stringify_source_path(project, version, '/')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue