A Python UPnP Media Server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.4 KiB

  1. --- Twisted-2.1.0/twisted/internet/tcp.py Sat Oct 8 21:10:44 2005
  2. +++ /usr/local/lib/python2.4/site-packages/twisted/internet/tcp.py Tue Sep 5 23:33:41 2006
  3. @@ -43,6 +43,7 @@
  4. from errno import WSAEINPROGRESS as EINPROGRESS
  5. from errno import WSAEALREADY as EALREADY
  6. from errno import WSAECONNRESET as ECONNRESET
  7. + from errno import WSAECONNRESET as ECONNABORTED
  8. from errno import WSAEISCONN as EISCONN
  9. from errno import WSAENOTCONN as ENOTCONN
  10. from errno import WSAEINTR as EINTR
  11. @@ -55,6 +56,7 @@
  12. from errno import EINPROGRESS
  13. from errno import EALREADY
  14. from errno import ECONNRESET
  15. + from errno import ECONNABORTED
  16. from errno import EISCONN
  17. from errno import ENOTCONN
  18. from errno import EINTR
  19. @@ -752,10 +754,13 @@
  20. try:
  21. skt, addr = self.socket.accept()
  22. except socket.error, e:
  23. - if e.args[0] in (EWOULDBLOCK, EAGAIN):
  24. + errno = e.args[0]
  25. + if not isinstance(errno, type(EAGAIN)):
  26. + errno = errno[0]
  27. + if errno in (EWOULDBLOCK, EAGAIN, ECONNABORTED):
  28. self.numberAccepts = i
  29. break
  30. - elif e.args[0] == EPERM:
  31. + elif errno == EPERM:
  32. continue
  33. raise