Commit Graph

7698 Commits

Author SHA1 Message Date
Aldo Cortesi
d12186a935
Merge pull request #3090 from cortesi/iflight
Redesign keepserving
2018-05-02 13:45:06 +12:00
Aldo Cortesi
2f3ba1f66d Catch some stray command.call invocations 2018-05-02 12:08:15 +12:00
Aldo Cortesi
0f6072050a
Merge pull request #3089 from cortesi/creplay
Revamp client replay
2018-05-02 11:33:45 +12:00
Aldo Cortesi
38ff8109fb taddons: remove has_event
We no longer use this anywhere, so ditch it.
2018-05-02 11:31:28 +12:00
Aldo Cortesi
22a4b1d5d4 Redesign keepserving
- Instead of listening for a pseudo-event, we periodically check whether client
replay, server replay or file reading is active.
- Adjust server replay not to
use tick.
- Adjust readfile to expose a command to check whether reading is in progress.
2018-05-02 11:26:40 +12:00
Aldo Cortesi
e963408434 console: use replay count commands in statusbar
Also add a periodic refresh every 0.5 seconds for the statusbar. This is in
addition to refreshes upon event update notifications, and picks up replay
status changes not linked to flow events.
2018-05-02 09:43:42 +12:00
Aldo Cortesi
42b04a5413 server replay: expose the replay.server.count command 2018-05-02 09:02:27 +12:00
Aldo Cortesi
204726349d client replay: replaying flows in-flight should be added to count() 2018-05-02 08:50:17 +12:00
Aldo Cortesi
00d790fe84 commands: clarify command call interface, fix web app replay 2018-05-02 08:36:15 +12:00
Aldo Cortesi
09c36a8c7c client replay: use count command for console statusbar 2018-05-01 09:04:59 +12:00
Aldo Cortesi
6d27b28b85 client replay: expad and consolidate tests 2018-05-01 08:47:26 +12:00
Aldo Cortesi
e8dac2d290 client replay: revert our changes if replay is aborted 2018-04-30 17:19:39 +12:00
Aldo Cortesi
236a2fb6fd client replay: re-design
Re-design the way client replay works. Before, we would fire up a thread,
replay, wait for the thread to complete, get the next flow, and repeat the
procedure. Now, we have one replay thread that starts when the addon starts,
which pops flows off a thread-safe queue. This is much cleaner, removes the
need for busy tick, and sets the scene for optimisations like server connection
reuse down the track.
2018-04-30 17:17:03 +12:00
Aldo Cortesi
28d53d5a24 client replay: move all client replay-related code into addon 2018-04-27 16:34:56 +12:00
Aldo Cortesi
bc3ace6082
Merge pull request #3082 from p1uymi/patch-2
Changed syntax of two options (from v2 to v3)
2018-04-27 11:20:20 +12:00
Aldo Cortesi
abc36a5f6b
Merge pull request #3083 from mitmproxy/requires-io-master
[requires.io] dependency update on master branch
2018-04-27 11:19:34 +12:00
requires.io
b3f3e97377 [requires.io] dependency update 2018-04-27 00:11:43 +02:00
requires.io
710880a652 [requires.io] dependency update 2018-04-26 22:41:36 +02:00
p1uymi
93a59acaeb
Changed syntax from v2 to v3
--client-certs = v2 syntax --> --set client_certs=value = v3 syntax
--cadir = v2 syntax --> --set cadir=value = v3 syntax
2018-04-26 16:14:27 +02:00
Aldo Cortesi
a4a48a96d6
Merge pull request #3078 from kajojify/expanduser
Fix #3002. Auto-expanding for tilda.
2018-04-26 21:02:10 +12:00
Miroslav
a42443b029 Incompatible types 2018-04-26 08:41:48 +03:00
Miroslav
d7abdd86e8 Lint 2018-04-26 08:21:46 +03:00
Aldo Cortesi
13f3cbed4f
Merge pull request #3076 from clyfish/keepalive
add SO_KEEPALIVE
2018-04-26 11:49:34 +12:00
Aldo Cortesi
b18e0fa2bc
Merge pull request #3071 from cortesi/tickless
asyncio: shift script reloading out of the tick event
2018-04-26 11:47:07 +12:00
Miroslav
ea6fab09b5 Fix #3002. Auto-expanding 2018-04-26 01:35:44 +03:00
Maximilian Hils
5546f0a05e
Merge pull request #3077 from mhils/pytest-fix
Fix pytest invocation errors
2018-04-25 06:15:28 -06:00
Maximilian Hils
19ceb6f49a fix pytest invocation errors 2018-04-25 14:00:50 +02:00
Cheng Liangyu
c7ce8a8343 add SO_KEEPALIVE 2018-04-25 17:50:59 +08:00
Aldo Cortesi
95e690ba31 test: shift test_data out of our public API 2018-04-23 19:16:33 +12:00
Aldo Cortesi
0ba10b6109 addons/script: improve relability of reload test
The granularity of mtime is surprisingly bad. Make the tests more robust
against this, and promote has_log back to a public method, now that we have a
few legitimate examples.
2018-04-23 13:19:20 +12:00
Aldo Cortesi
44016a0de5 asyncio: shift script reloading out of the tick event
The tick event is a nasty compromise, left over from when we didn't have an
event loop. This is the first patch in a series that explores moving our
built-in addons to managing coroutines on the eventloop directly for periodic
tasks.
2018-04-23 10:28:18 +12:00
Thomas Kriechbaumer
f6b606b364
Merge pull request #3070 from CorTal/Fix#3066
Fix asyncio.call_soon -> asyncio.ensure_future
2018-04-18 16:38:52 +02:00
CorTal
ab01406585 call_soon->ensure_future 2018-04-18 10:31:43 +02:00
Aldo Cortesi
6d5c8781e2
Merge pull request #3069 from cortesi/mweb
A grab-bag of mitmweb-related fixes
2018-04-18 09:17:14 +12:00
Aldo Cortesi
e6538cdb1f mitmweb: don't blort all over my config file
Temporarily disable config saving until we can look at this more closely.
Config saving should:

- Only happen when explicitly requested by the user
- Only save changed values
2018-04-18 09:01:42 +12:00
Aldo Cortesi
bca0275427 tcp: As of Python 3.5, EINTR is retried automatically by select
See https://www.python.org/dev/peps/pep-0475/
2018-04-18 08:22:26 +12:00
Aldo Cortesi
8396244729 mitmweb: shift to use new run_loop wrapper on master
Fixes #3067
2018-04-18 08:21:08 +12:00
Aldo Cortesi
633023701b
Merge pull request #3064 from cortesi/mexit
asyncio: fix exit behaviour for console
2018-04-18 07:58:51 +12:00
Aldo Cortesi
df83c0eef7 asyncio: fix exit behavior for console
- Add a master.run_loop function. This encapsulates our run behaviour so that
it can be used by implementations that need to manage their own run loop (like urwid).
- Shift crash exit message to the common core. I'm not convinced we really need
this, but if we want it it should be centralised.
- Clean up an extra exception that can be thrown by asyncio itself on "dirty"
termination after a mitmproxy crash.
2018-04-17 10:42:40 +12:00
Aldo Cortesi
14aa61b6b1
Merge pull request #3063 from cortesi/sigs
Ignore signal errors on windows + various fixes
2018-04-17 10:18:45 +12:00
Aldo Cortesi
ef4db52887 Ignore signal errors on windows + various fixes
- Ignore the NotImplementedError raised by add_signal_handler on Windows.
- Entrypoints return an integer exit code, or None. Adjust our type annotations
and code to suit.

Fixes #3061
2018-04-17 08:20:52 +12:00
Aldo Cortesi
754cb6cac9
Merge pull request #3048 from cortesi/qbench
Improve benchmarking
2018-04-17 07:35:12 +12:00
Aldo Cortesi
565146311a asyncio: clarify shutdown semantics
This patch clarifies proxy shutdown, and specifies that the master.shutdown()
method is thread-save.
2018-04-16 10:16:51 +12:00
Aldo Cortesi
850c855495 Clean up test/helper_tools directory 2018-04-16 09:20:22 +12:00
Aldo Cortesi
b663a224a3 Improve benchmarking
- The benchmark addon now manages setting up and tearing down the backend and
traffic processes itself.
- Use wrk instead of hey. I get more consistent results with this tool, and hey
shows a strange tail-latency bump that seems artificial.
- Make termination behaviour simpler. The bencmark revealed a bug where .done
events were not called if the proxy was shut down by an addon.
2018-04-16 09:19:14 +12:00
Aldo Cortesi
5f74adc2df
Merge pull request #3059 from obscure76/enh/issue-3053
fix Python 3.6 variable type annotations #3053
2018-04-16 07:35:20 +12:00
oscure76
0e984e1442 fix Python 3.6 variable type annotations #3053 2018-04-14 16:24:41 -07:00
Aldo Cortesi
865a373bd3
Merge pull request #3050 from kira0204/error-script
Handling user script's exceptions, fix #2839
2018-04-15 10:12:44 +12:00
Aldo Cortesi
cabb788072
Merge pull request #3057 from mitmproxy/requires-io-master
[requires.io] dependency update on master branch
2018-04-15 10:03:54 +12:00
Aldo Cortesi
4e126c0fba
Merge pull request #3056 from cortesi/readfile
readfile fixes
2018-04-15 10:03:30 +12:00