Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
caucase
Commits
40bd5a05
Commit
40bd5a05
authored
Oct 19, 2018
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: Use print for stderr too.
Avoids hardcoding newline char.
parent
78162dee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
6 deletions
+8
-6
caucase/http.py
caucase/http.py
+8
-6
No files found.
caucase/http.py
View file @
40bd5a05
...
@@ -181,13 +181,14 @@ class CaucaseSSLWSGIRequestHandler(CaucaseWSGIRequestHandler):
...
@@ -181,13 +181,14 @@ class CaucaseSSLWSGIRequestHandler(CaucaseWSGIRequestHandler):
def
log_message
(
self
,
format
,
*
args
):
def
log_message
(
self
,
format
,
*
args
):
# Note: compared to BaseHTTPHandler, logs the client certificate serial as
# Note: compared to BaseHTTPHandler, logs the client certificate serial as
# user name.
# user name.
sys
.
stderr
.
write
(
print
(
"%s - %s [%s] %s
\
n
"
%
(
"%s - %s [%s] %s"
%
(
self
.
client_address
[
0
],
self
.
client_address
[
0
],
self
.
ssl_client_cert_serial
,
self
.
ssl_client_cert_serial
,
self
.
log_date_time_string
(),
self
.
log_date_time_string
(),
format
%
args
,
format
%
args
,
)
),
file
=
sys
.
stderr
,
)
)
# pylint: enable=redefined-builtin
# pylint: enable=redefined-builtin
...
@@ -662,12 +663,13 @@ def main(argv=None, until=utils.until):
...
@@ -662,12 +663,13 @@ def main(argv=None, until=utils.until):
if
host
in
known_host_set
:
if
host
in
known_host_set
:
continue
continue
known_host_set
.
add
(
host
)
known_host_set
.
add
(
host
)
sys
.
stderr
.
write
(
print
(
'Listening on [%s]:%i-%i
\
n
'
%
(
'Listening on [%s]:%i-%i'
%
(
host
,
host
,
http_port
,
http_port
,
https_port
,
https_port
,
),
),
file
=
sys
.
stderr
,
)
)
http_list
.
append
(
http_list
.
append
(
make_server
(
make_server
(
...
@@ -780,7 +782,7 @@ def main(argv=None, until=utils.until):
...
@@ -780,7 +782,7 @@ def main(argv=None, until=utils.until):
except
utils
.
SleepInterrupt
:
except
utils
.
SleepInterrupt
:
pass
pass
finally
:
finally
:
sys
.
stderr
.
write
(
'Exiting
\
n
'
)
print
(
'Exiting'
,
file
=
sys
.
stderr
)
for
server
in
itertools
.
chain
(
http_list
,
https_list
):
for
server
in
itertools
.
chain
(
http_list
,
https_list
):
server
.
server_close
()
server
.
server_close
()
server
.
shutdown
()
server
.
shutdown
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment