diff --git a/cheroot/_compat.py b/cheroot/_compat.py index 0e4ed182b4..79899b9d1a 100644 --- a/cheroot/_compat.py +++ b/cheroot/_compat.py @@ -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'): diff --git a/cheroot/server.py b/cheroot/server.py index 7aed63e50f..3c00164975 100644 --- a/cheroot/server.py +++ b/cheroot/server.py @@ -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 @@ -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'