Merge branch 'master' of https://github.com/channelcat/sanic
This commit is contained in:
commit
7f60f85cd4
|
@ -1,6 +1,6 @@
|
||||||
from sanic.app import Sanic
|
from sanic.app import Sanic
|
||||||
from sanic.blueprints import Blueprint
|
from sanic.blueprints import Blueprint
|
||||||
|
|
||||||
__version__ = '0.5.0'
|
__version__ = '0.5.1'
|
||||||
|
|
||||||
__all__ = ['Sanic', 'Blueprint']
|
__all__ = ['Sanic', 'Blueprint']
|
||||||
|
|
|
@ -93,6 +93,10 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
self._last_request_time = None
|
self._last_request_time = None
|
||||||
self._request_handler_task = None
|
self._request_handler_task = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def keep_alive(self):
|
||||||
|
return self.parser.should_keep_alive() and not self.signal.stopped
|
||||||
|
|
||||||
# -------------------------------------------- #
|
# -------------------------------------------- #
|
||||||
# Connection
|
# Connection
|
||||||
# -------------------------------------------- #
|
# -------------------------------------------- #
|
||||||
|
@ -186,9 +190,7 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
Writes response content synchronously to the transport.
|
Writes response content synchronously to the transport.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
keep_alive = (
|
keep_alive = self.keep_alive
|
||||||
self.parser.should_keep_alive() and not self.signal.stopped)
|
|
||||||
|
|
||||||
self.transport.write(
|
self.transport.write(
|
||||||
response.output(
|
response.output(
|
||||||
self.request.version, keep_alive,
|
self.request.version, keep_alive,
|
||||||
|
@ -230,9 +232,7 @@ class HttpProtocol(asyncio.Protocol):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
keep_alive = (
|
keep_alive = self.keep_alive
|
||||||
self.parser.should_keep_alive() and not self.signal.stopped)
|
|
||||||
|
|
||||||
response.transport = self.transport
|
response.transport = self.transport
|
||||||
await response.stream(
|
await response.stream(
|
||||||
self.request.version, keep_alive, self.request_timeout)
|
self.request.version, keep_alive, self.request_timeout)
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -64,7 +64,3 @@ except DistutilsPlatformError as exception:
|
||||||
print("Installing without uJSON or uvLoop")
|
print("Installing without uJSON or uvLoop")
|
||||||
setup_kwargs['install_requires'] = requirements
|
setup_kwargs['install_requires'] = requirements
|
||||||
setup(**setup_kwargs)
|
setup(**setup_kwargs)
|
||||||
|
|
||||||
# Installation was successful
|
|
||||||
print(u"\n\n\U0001F680 "
|
|
||||||
"Sanic version {} installation suceeded.\n".format(version))
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user