Skip to content

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cheroot/_compat.py
Expand Up @@ -24,6 +24,9 @@
IS_LINUX = SYS_PLATFORM == 'Linux'
IS_MACOS = SYS_PLATFORM == 'Darwin'

PLATFORM_ARCH = platform.machine()
IS_PPC = PLATFORM_ARCH.startswith('ppc')


if not six.PY2:
def ntob(n, encoding='ISO-8859-1'):
Expand Down
3 changes: 2 additions & 1 deletion cheroot/server.py
Expand Up @@ -86,6 +86,7 @@

from . import errors, __version__
from ._compat import bton, ntou
from ._compat import IS_PPC
from .workers import threadpool
from .makefile import MakeFile, StreamWriter

Expand Down Expand Up @@ -142,7 +143,7 @@
which case the getsockopt() will hopefully fail. The arch
specific value could be derived from platform.processor()
"""
socket.SO_PEERCRED = 17
socket.SO_PEERCRED = 21 if IS_PPC else 17


LF = b'\n'
Expand Down

0 comments on commit 621f4ee

Please sign in to comment.