[~] Refactor
This commit is contained in:
parent
b0ff8b86de
commit
f38336a795
8
d1/f2.py
8
d1/f2.py
@ -35,6 +35,9 @@ def application(environ, start_response):
|
|||||||
protocol=environ['SERVER_PROTOCOL'],
|
protocol=environ['SERVER_PROTOCOL'],
|
||||||
)
|
)
|
||||||
try:
|
try:
|
||||||
|
with io.open('2.dat', 'wb') as f:
|
||||||
|
f.write(t3)
|
||||||
|
|
||||||
t17 = [
|
t17 = [
|
||||||
'curl',
|
'curl',
|
||||||
'http://127.0.0.1:9050%s' % t7['uri'],
|
'http://127.0.0.1:9050%s' % t7['uri'],
|
||||||
@ -43,7 +46,7 @@ def application(environ, start_response):
|
|||||||
for k, v in t2.items()
|
for k, v in t2.items()
|
||||||
], []),
|
], []),
|
||||||
'-X', t7['method'],
|
'-X', t7['method'],
|
||||||
'-d', '@-',
|
'--data-binary', '@2.dat',
|
||||||
'--max-filesize', '%d' % (60 * 1024 * 1024),
|
'--max-filesize', '%d' % (60 * 1024 * 1024),
|
||||||
'-o', '1.dat',
|
'-o', '1.dat',
|
||||||
'-v',
|
'-v',
|
||||||
@ -54,9 +57,6 @@ def application(environ, start_response):
|
|||||||
with subprocess.Popen(
|
with subprocess.Popen(
|
||||||
t17, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE
|
t17, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE
|
||||||
) as p:
|
) as p:
|
||||||
p.stdin.write(t3)
|
|
||||||
p.stdin.flush()
|
|
||||||
p.stdin.close()
|
|
||||||
try:
|
try:
|
||||||
p.wait(20)
|
p.wait(20)
|
||||||
response_headers = [
|
response_headers = [
|
||||||
|
Loading…
Reference in New Issue
Block a user