Commit Graph

121 Commits

Author SHA1 Message Date
38elements
7fe418d1b7 Refactor keep_alive 2017-04-12 17:55:22 +09:00
aryeh
b9dfec38c2 Break long line (> 80 chars) into 2 lines 2017-04-09 13:38:36 -04:00
aryeh
2ef8120073 Allow a custom Request class to be passed in to Sonic
Allowing a custom Request class to be defined would enable either a different Request class or a subclass of Request to be used, providing more flexibility.
2017-04-09 13:29:21 -04:00
Raphael Deem
1854ad133c use socket.set_inheritable instead of os version 2017-04-04 13:13:52 -07:00
Raphael Deem
1ddb01ac44 remove stop_event 2017-03-26 15:48:41 -07:00
messense
e27812bf3e
Set signal.stopped = True on closing 2017-03-20 14:25:32 +08:00
messense
a90d70feae
Check connections is not None 2017-03-20 14:25:32 +08:00
messense
2b296435b3
Trigger events 2017-03-20 14:25:31 +08:00
Cadel Watson
d713533d26 Fix docstring formatting errors 2017-03-16 16:52:18 +11:00
38elements
313535c599 Fix bail_out() 2017-03-09 13:36:01 +09:00
Eli Uriegas
19592e8eea Merge pull request #473 from subyraman/explore-streams-v2
Add `stream` method for streaming content, add docs and examples
2017-03-05 17:51:44 -08:00
(Zenix) Han-Sheng Huang
62bf213a6e pass flake8 2017-03-02 13:42:55 +09:00
(Zenix) Han-Sheng Huang
e5c32e9b48 special handling when sock is provided and number of workers > 1 2017-03-02 13:27:52 +09:00
Suby Raman
fa13ad8849 clean up imports 2017-02-21 11:36:45 -05:00
Suby Raman
8b23dec322 improve performance 2017-02-21 11:28:45 -05:00
Suby Raman
4e8aac4b41 rebase 2017-02-21 11:05:06 -05:00
Eli Uriegas
0b914866eb Merge pull request #401 from youknowone/error-logging
Enhance error logging
2017-02-17 07:01:40 -06:00
Jeong YunWon
b44e8167d7 Enhance error logging
- Prevent to fall into error logging recursion when it doesn't have
request info (Print 'Unknown' when the request is still `None`
- Print repr(e) rather than str(e)
2017-02-17 14:05:46 +09:00
Eli Uriegas
04c8f4a5ed Adds some safety around response types being wrong
Before we didn't check if the response object was actually a response
object. This PR catches the exception should it happen and reports it to
the user.
2017-02-16 17:49:14 -06:00
Eli Uriegas
6ecf2a6eb2 Merge pull request #439 from seemethere/move_sanic_to_app
Moves sanic/sanic.py to sanic/app.py
2017-02-15 21:03:41 -06:00
Eli Uriegas
54b2d74068 Get rid of relative imports 2017-02-15 20:54:00 -06:00
Raphael Deem
1cf1024332 Merge branch 'master' into 420 2017-02-15 09:29:52 -08:00
Raphael Deem
efc90f8f5a Merge pull request #434 from agoose77/fix_warn_error
Fix mistake in warning
2017-02-14 16:46:37 -08:00
Angus Hollands
6535ba7c24 Fix mistake in warning 2017-02-14 20:53:55 +00:00
Angus Hollands
51611c3934 Pep8 cleanups (#429)
* PEP8 cleanups

* PEP8 cleanups (server.py)

* PEP8 cleanups (blueprints.py)

* PEP8 cleanups (config.py)

* PEP8 cleanups (cookies.py)

* PEP8 cleanups (handlers.py)

* PEP8 cleanups (request.py)

* PEP8 cleanups (response.py)

* PEP8 cleanups (router.py)

* PEP8 cleanups (sanic.py) #2

* PEP8 cleanups (server.py) #2

* PEP8 cleanups (static.py)

* PEP8 cleanups (utils.py)

* PEP8 cleanups (views.py)
Updated docstring
2017-02-14 13:10:19 -06:00
Angus Hollands
56f56d008a Simplify trigger events (now guaranteeed to receive list of events)
Don't bother checking if list empty - this function is not called often
2017-02-14 15:15:15 +00:00
Raphael Deem
de6c646ee8 move logging to method in ErrorHandler 2017-02-13 19:44:54 -08:00
Raphael Deem
41c6125e1b use try/except when adding loop sig handlers 2017-02-12 14:43:00 -08:00
Fengyuan Chen
884749f345 fix run_async demo 2017-02-04 15:27:46 +08:00
Eli Uriegas
487e3352e4 Revert "fix async run, add tests"
This reverts commit 41da793b5a.
2017-01-31 07:30:17 -06:00
Raphael Deem
41da793b5a fix async run, add tests 2017-01-29 23:47:47 -08:00
Raphael Deem
0eb779185d fix deprecation warnings 2017-01-27 18:09:19 -08:00
Eli Uriegas
59242df7d6 Move serve_multiple, fix tests (#357)
* Move serve_multiple, remove stop_events, fix tests

Moves serve_multiple out of the app, removes stop_event (adds a
deprecation warning, but it also wasn't doing anything) fixes
multiprocessing tests so that they don't freeze pytest's runner.

Other notes:

Also moves around some imports so that they are better optimized as
well.

* Re-add in stop_event, maybe it wasn't so bad!

* Get rid of unused warnings import
2017-01-27 19:34:21 -06:00
Raphael Deem
d52f5f0b09 remove loop as argument and update examples 2017-01-26 17:38:46 -08:00
Eli Uriegas
d1c4f3172f Merge pull request #348 from r0fls/275
add async run
2017-01-26 10:37:52 -06:00
Raphael Deem
54ca8c787b add async run 2017-01-25 22:47:18 -08:00
Channel Cat
88c3bffe20 Merge pull request #342 from channelcat/fix-slow-upload
Fix slow upload
2017-01-25 22:04:48 -08:00
Channel Cat
fd118a41fd Only use request.body 2017-01-25 21:56:49 -08:00
Raphael Deem
4efcb6d5ad fix before/after event docstrings 2017-01-25 16:25:16 -08:00
Channel Cat
85a28d3c30 Fix slow upload 2017-01-25 01:19:21 -08:00
Eli Uriegas
214162adf0 Merge branch 'master' into add_register_sys_signals_flag 2017-01-21 10:25:57 -06:00
Eli Uriegas
bef34d66f5 Merge pull request #314 from seemethere/make_closed_transport_handling_more_robust
Add exception handling for closed transports
2017-01-19 21:31:30 -06:00
Eli Uriegas
ed4752bbc0 Move transport close to finally statment 2017-01-19 16:35:48 -06:00
Cadel Watson
7c4ffa8866 Merge branch 'master' into sphinx-docs 2017-01-20 09:30:42 +11:00
Raphael Deem
d2217b5c5f Merge branch 'master' into ssl 2017-01-19 11:23:21 -08:00
Eli Uriegas
e9bfa30c1d Add exception handling for closed transports
Adds handling for closed transports in the server for `write_response`
as well as `write_error`, letting it all flow to `bail_out` seemed to be
a little light handed in terms of telling the logs where the
error actually occured.

Handling to fix the infinite `write_error` loop is still there and those
exceptions will get reported on in the debug logs.
2017-01-18 23:46:22 -06:00
Cadel Watson
9d4b104d2d Merge branch 'master' into sphinx-docs 2017-01-19 08:48:54 +11:00
Raphael Deem
9102a9cd6e Merge branch 'master' into ssl 2017-01-17 18:09:33 -08:00
Eli Uriegas
573d1da0ef Fixes write_error loop from bail_out function
Fixes stack-overflow found in #307
2017-01-17 18:28:22 -06:00
Channel Cat
2aa380c5a3 Merge pull request #302 from channelcat/request-headers-ci
Trimmed down features of CIMultiDict
2017-01-16 17:08:12 -08:00