bypass all session logic when application does not exist, and close files
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.6.0-development+timestamp.2013.08.29.08.09.00
|
Version 2.6.0-development+timestamp.2013.08.29.08.21.46
|
||||||
|
|||||||
+39
-40
@@ -455,58 +455,57 @@ def wsgibase(environ, responder):
|
|||||||
|
|
||||||
except HTTP, http_response:
|
except HTTP, http_response:
|
||||||
|
|
||||||
# if this is a static file
|
if static_file:
|
||||||
# or the application does not exist
|
|
||||||
if static_file or not hasattr(current,'request'):
|
|
||||||
return http_response.to(responder, env=env)
|
return http_response.to(responder, env=env)
|
||||||
|
|
||||||
if request.body:
|
if request.body:
|
||||||
request.body.close()
|
request.body.close()
|
||||||
|
|
||||||
# ##################################################
|
if hasattr(current,'request'):
|
||||||
# on success, try store session in database
|
|
||||||
# ##################################################
|
|
||||||
session._try_store_in_db(request, response)
|
|
||||||
|
|
||||||
# ##################################################
|
# ##################################################
|
||||||
# on success, commit database
|
# on success, try store session in database
|
||||||
# ##################################################
|
# ##################################################
|
||||||
|
session._try_store_in_db(request, response)
|
||||||
|
|
||||||
if response.do_not_commit is True:
|
# ##################################################
|
||||||
BaseAdapter.close_all_instances(None)
|
# on success, commit database
|
||||||
# elif response._custom_commit:
|
# ##################################################
|
||||||
# response._custom_commit()
|
|
||||||
elif response.custom_commit:
|
if response.do_not_commit is True:
|
||||||
BaseAdapter.close_all_instances(response.custom_commit)
|
BaseAdapter.close_all_instances(None)
|
||||||
else:
|
elif response.custom_commit:
|
||||||
BaseAdapter.close_all_instances('commit')
|
BaseAdapter.close_all_instances(response.custom_commit)
|
||||||
|
else:
|
||||||
|
BaseAdapter.close_all_instances('commit')
|
||||||
|
|
||||||
# ##################################################
|
# ##################################################
|
||||||
# if session not in db try store session on filesystem
|
# if session not in db try store session on filesystem
|
||||||
# this must be done after trying to commit database!
|
# this must be done after trying to commit database!
|
||||||
# ##################################################
|
# ##################################################
|
||||||
|
|
||||||
session._try_store_in_cookie_or_file(request, response)
|
session._try_store_in_cookie_or_file(request, response)
|
||||||
|
|
||||||
if request.cid:
|
if request.cid:
|
||||||
if response.flash:
|
if response.flash:
|
||||||
http_response.headers['web2py-component-flash'] = \
|
http_response.headers['web2py-component-flash'] = \
|
||||||
urllib2.quote(xmlescape(response.flash)\
|
urllib2.quote(xmlescape(response.flash)\
|
||||||
.replace('\n',''))
|
.replace('\n',''))
|
||||||
if response.js:
|
if response.js:
|
||||||
http_response.headers['web2py-component-command'] = \
|
http_response.headers['web2py-component-command'] = \
|
||||||
urllib2.quote(response.js.replace('\n',''))
|
urllib2.quote(response.js.replace('\n',''))
|
||||||
|
|
||||||
|
# ##################################################
|
||||||
|
# store cookies in headers
|
||||||
|
# ##################################################
|
||||||
|
|
||||||
# ##################################################
|
rcookies = response.cookies
|
||||||
# store cookies in headers
|
if session._forget and response.session_id_name in rcookies:
|
||||||
# ##################################################
|
del rcookies[response.session_id_name]
|
||||||
|
elif session._secure:
|
||||||
|
rcookies[response.session_id_name]['secure'] = True
|
||||||
|
http_response.cookies2headers(rcookies)
|
||||||
|
|
||||||
rcookies = response.cookies
|
|
||||||
if session._forget and response.session_id_name in rcookies:
|
|
||||||
del rcookies[response.session_id_name]
|
|
||||||
elif session._secure:
|
|
||||||
rcookies[response.session_id_name]['secure'] = True
|
|
||||||
http_response.cookies2headers(rcookies)
|
|
||||||
ticket = None
|
ticket = None
|
||||||
|
|
||||||
except RestrictedError, e:
|
except RestrictedError, e:
|
||||||
|
|||||||
Reference in New Issue
Block a user