Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
64c8b915
Commit
64c8b915
authored
May 01, 2001
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backport of former medusa patches
parent
1efa3fa3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
28 deletions
+42
-28
ZServer/medusa/http_server.py
ZServer/medusa/http_server.py
+21
-14
lib/python/ZServer/medusa/http_server.py
lib/python/ZServer/medusa/http_server.py
+21
-14
No files found.
ZServer/medusa/http_server.py
View file @
64c8b915
...
...
@@ -6,7 +6,7 @@
# All Rights Reserved.
#
RCS_ID
=
'$Id: http_server.py,v 1.2
4 2001/05/01 11:44:48
andreas Exp $'
RCS_ID
=
'$Id: http_server.py,v 1.2
5 2001/05/01 12:49:04
andreas Exp $'
# python modules
import
os
...
...
@@ -259,21 +259,28 @@ class http_request:
self
.
channel
.
close_when_done
()
def
log_date_string
(
self
,
when
):
return
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
time
.
gmtime
(
when
)
)
+
tz_for_log
logtime
=
time
.
localtime
(
when
)
return
time
.
strftime
(
'%d/'
,
logtime
)
+
\
http_date
.
monthname
[
logtime
[
1
]]
+
\
time
.
strftime
(
'/%Y:%H:%M:%S '
,
logtime
)
+
\
tz_for_log
def
log
(
self
,
bytes
):
user_agent
=
self
.
get_header
(
'user-agent'
)
if
not
user_agent
:
user_agent
=
''
referer
=
self
.
get_header
(
'referer'
)
if
not
referer
:
referer
=
''
self
.
channel
.
server
.
logger
.
log
(
self
.
channel
.
addr
[
0
],
' - - [%s] "%s" %d %d
\
n
'
%
(
self
.
log_date_string
(
time
.
time
()),
self
.
request
,
self
.
reply_code
,
bytes
)
self
.
channel
.
addr
[
0
],
' - - [%s] "%s" %d %d "%s" "%s"
\
n
'
%
(
self
.
log_date_string
(
time
.
time
()),
self
.
request
,
self
.
reply_code
,
bytes
,
referer
,
user_agent
)
)
responses
=
{
100
:
"Continue"
,
...
...
@@ -460,7 +467,7 @@ class http_channel (asynchat.async_chat):
# unquote path if necessary (thanks to Skip Montaro for pointing
# out that we must unquote in piecemeal fashion).
# ajung:
unquote
the request *after* calling crack_request because
# ajung:
we unquote()
the request *after* calling crack_request because
# this function breaks when it gets an unquoted request
if
'%'
in
request
:
...
...
lib/python/ZServer/medusa/http_server.py
View file @
64c8b915
...
...
@@ -6,7 +6,7 @@
# All Rights Reserved.
#
RCS_ID
=
'$Id: http_server.py,v 1.2
4 2001/05/01 11:44:48
andreas Exp $'
RCS_ID
=
'$Id: http_server.py,v 1.2
5 2001/05/01 12:49:04
andreas Exp $'
# python modules
import
os
...
...
@@ -259,21 +259,28 @@ class http_request:
self
.
channel
.
close_when_done
()
def
log_date_string
(
self
,
when
):
return
time
.
strftime
(
'%d/%b/%Y:%H:%M:%S '
,
time
.
gmtime
(
when
)
)
+
tz_for_log
logtime
=
time
.
localtime
(
when
)
return
time
.
strftime
(
'%d/'
,
logtime
)
+
\
http_date
.
monthname
[
logtime
[
1
]]
+
\
time
.
strftime
(
'/%Y:%H:%M:%S '
,
logtime
)
+
\
tz_for_log
def
log
(
self
,
bytes
):
user_agent
=
self
.
get_header
(
'user-agent'
)
if
not
user_agent
:
user_agent
=
''
referer
=
self
.
get_header
(
'referer'
)
if
not
referer
:
referer
=
''
self
.
channel
.
server
.
logger
.
log
(
self
.
channel
.
addr
[
0
],
' - - [%s] "%s" %d %d
\
n
'
%
(
self
.
log_date_string
(
time
.
time
()),
self
.
request
,
self
.
reply_code
,
bytes
)
self
.
channel
.
addr
[
0
],
' - - [%s] "%s" %d %d "%s" "%s"
\
n
'
%
(
self
.
log_date_string
(
time
.
time
()),
self
.
request
,
self
.
reply_code
,
bytes
,
referer
,
user_agent
)
)
responses
=
{
100
:
"Continue"
,
...
...
@@ -460,7 +467,7 @@ class http_channel (asynchat.async_chat):
# unquote path if necessary (thanks to Skip Montaro for pointing
# out that we must unquote in piecemeal fashion).
# ajung:
unquote
the request *after* calling crack_request because
# ajung:
we unquote()
the request *after* calling crack_request because
# this function breaks when it gets an unquoted request
if
'%'
in
request
:
...
...
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