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
51efb515
Commit
51efb515
authored
Dec 21, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged log message fixups from 2.2 branch
parent
53109945
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
100 deletions
+54
-100
ZServer/FTPServer.py
ZServer/FTPServer.py
+13
-0
ZServer/HTTPServer.py
ZServer/HTTPServer.py
+14
-50
lib/python/ZServer/FTPServer.py
lib/python/ZServer/FTPServer.py
+13
-0
lib/python/ZServer/HTTPServer.py
lib/python/ZServer/HTTPServer.py
+14
-50
No files found.
ZServer/FTPServer.py
View file @
51efb515
...
...
@@ -615,10 +615,23 @@ class FTPServer(ftp_server):
ftp_channel_class
=
zope_ftp_channel
limiter
=
FTPLimiter
(
10
,
1
)
shutup
=
0
def
__init__
(
self
,
module
,
*
args
,
**
kw
):
self
.
shutup
=
1
apply
(
ftp_server
.
__init__
,
(
self
,
None
)
+
args
,
kw
)
self
.
shutup
=
0
self
.
module
=
module
self
.
log_info
(
'FTP server started at %s
\
n
'
'
\
t
Hostname: %s
\
n
\
t
Port: %d'
%
(
time
.
ctime
(
time
.
time
()),
self
.
hostname
,
self
.
port
))
def
log_info
(
self
,
message
,
type
=
'info'
):
if
self
.
shutup
:
return
asyncore
.
dispatcher
.
log_info
(
self
,
message
,
type
)
def
handle_accept
(
self
):
conn
,
addr
=
self
.
accept
()
...
...
ZServer/HTTPServer.py
View file @
51efb515
...
...
@@ -384,58 +384,22 @@ class zhttp_server(http_server):
SERVER_IDENT
=
'Zope/%s ZServer/%s'
%
(
ZOPE_VERSION
,
ZSERVER_VERSION
)
channel_class
=
zhttp_channel
shutup
=
0
def
__init__
(
self
,
ip
,
port
,
resolver
=
None
,
logger_object
=
None
):
self
.
ip
=
ip
self
.
port
=
port
asyncore
.
dispatcher
.
__init__
(
self
)
self
.
create_socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
handlers
=
[]
if
not
logger_object
:
logger_object
=
logger
.
file_logger
(
sys
.
stdout
)
self
.
set_reuse_addr
()
self
.
bind
((
ip
,
port
))
# lower this to 5 if your OS complains
self
.
listen
(
1024
)
host
,
port
=
self
.
socket
.
getsockname
()
if
not
ip
:
ip
=
socket
.
gethostbyname
(
socket
.
gethostname
())
try
:
self
.
server_name
=
socket
.
gethostbyaddr
(
ip
)[
0
]
except
socket
.
error
:
self
.
log_info
(
'Cannot do reverse lookup for server address'
,
'warning'
)
self
.
server_name
=
ip
# use the IP address as the "hostname"
self
.
server_port
=
port
self
.
total_clients
=
counter
.
counter
()
self
.
total_requests
=
counter
.
counter
()
self
.
exceptions
=
counter
.
counter
()
self
.
bytes_out
=
counter
.
counter
()
self
.
bytes_in
=
counter
.
counter
()
if
not
logger_object
:
logger_object
=
logger
.
file_logger
(
sys
.
stdout
)
if
resolver
:
self
.
logger
=
logger
.
resolving_logger
(
resolver
,
logger_object
)
else
:
self
.
logger
=
logger
.
unresolving_logger
(
logger_object
)
self
.
log_info
(
'HTTP server (V%s) started at %s
\
n
'
'
\
t
Server URL: http://%s:%s/
\
n
'
%
(
VERSION_STRING
,
self
.
shutup
=
1
http_server
.
__init__
(
self
,
ip
,
port
,
resolver
,
logger_object
)
self
.
shutup
=
0
self
.
log_info
(
'HTTP server started at %s
\
n
'
'
\
t
Hostname: %s
\
n
\
t
Port: %d'
%
(
time
.
ctime
(
time
.
time
()),
self
.
server_name
,
port
,
)
)
self
.
server_port
))
def
log_info
(
self
,
message
,
type
=
'info'
):
if
self
.
shutup
:
return
dispatcher
.
log_info
(
self
,
message
,
type
)
def
readable
(
self
):
return
self
.
accepting
and
\
...
...
lib/python/ZServer/FTPServer.py
View file @
51efb515
...
...
@@ -615,10 +615,23 @@ class FTPServer(ftp_server):
ftp_channel_class
=
zope_ftp_channel
limiter
=
FTPLimiter
(
10
,
1
)
shutup
=
0
def
__init__
(
self
,
module
,
*
args
,
**
kw
):
self
.
shutup
=
1
apply
(
ftp_server
.
__init__
,
(
self
,
None
)
+
args
,
kw
)
self
.
shutup
=
0
self
.
module
=
module
self
.
log_info
(
'FTP server started at %s
\
n
'
'
\
t
Hostname: %s
\
n
\
t
Port: %d'
%
(
time
.
ctime
(
time
.
time
()),
self
.
hostname
,
self
.
port
))
def
log_info
(
self
,
message
,
type
=
'info'
):
if
self
.
shutup
:
return
asyncore
.
dispatcher
.
log_info
(
self
,
message
,
type
)
def
handle_accept
(
self
):
conn
,
addr
=
self
.
accept
()
...
...
lib/python/ZServer/HTTPServer.py
View file @
51efb515
...
...
@@ -384,58 +384,22 @@ class zhttp_server(http_server):
SERVER_IDENT
=
'Zope/%s ZServer/%s'
%
(
ZOPE_VERSION
,
ZSERVER_VERSION
)
channel_class
=
zhttp_channel
shutup
=
0
def
__init__
(
self
,
ip
,
port
,
resolver
=
None
,
logger_object
=
None
):
self
.
ip
=
ip
self
.
port
=
port
asyncore
.
dispatcher
.
__init__
(
self
)
self
.
create_socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
handlers
=
[]
if
not
logger_object
:
logger_object
=
logger
.
file_logger
(
sys
.
stdout
)
self
.
set_reuse_addr
()
self
.
bind
((
ip
,
port
))
# lower this to 5 if your OS complains
self
.
listen
(
1024
)
host
,
port
=
self
.
socket
.
getsockname
()
if
not
ip
:
ip
=
socket
.
gethostbyname
(
socket
.
gethostname
())
try
:
self
.
server_name
=
socket
.
gethostbyaddr
(
ip
)[
0
]
except
socket
.
error
:
self
.
log_info
(
'Cannot do reverse lookup for server address'
,
'warning'
)
self
.
server_name
=
ip
# use the IP address as the "hostname"
self
.
server_port
=
port
self
.
total_clients
=
counter
.
counter
()
self
.
total_requests
=
counter
.
counter
()
self
.
exceptions
=
counter
.
counter
()
self
.
bytes_out
=
counter
.
counter
()
self
.
bytes_in
=
counter
.
counter
()
if
not
logger_object
:
logger_object
=
logger
.
file_logger
(
sys
.
stdout
)
if
resolver
:
self
.
logger
=
logger
.
resolving_logger
(
resolver
,
logger_object
)
else
:
self
.
logger
=
logger
.
unresolving_logger
(
logger_object
)
self
.
log_info
(
'HTTP server (V%s) started at %s
\
n
'
'
\
t
Server URL: http://%s:%s/
\
n
'
%
(
VERSION_STRING
,
self
.
shutup
=
1
http_server
.
__init__
(
self
,
ip
,
port
,
resolver
,
logger_object
)
self
.
shutup
=
0
self
.
log_info
(
'HTTP server started at %s
\
n
'
'
\
t
Hostname: %s
\
n
\
t
Port: %d'
%
(
time
.
ctime
(
time
.
time
()),
self
.
server_name
,
port
,
)
)
self
.
server_port
))
def
log_info
(
self
,
message
,
type
=
'info'
):
if
self
.
shutup
:
return
dispatcher
.
log_info
(
self
,
message
,
type
)
def
readable
(
self
):
return
self
.
accepting
and
\
...
...
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