summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* ssl: connect used non-monotonic time.time() for timeout (#520)Sergey Shepelev2018-08-261-5/+5
| | | | | | | | | Origin: https://github.com/eventlet/eventlet/pull/517 Related: https://github.com/eventlet/eventlet/pull/388 https://github.com/eventlet/eventlet/pull/303 https://github.com/eventlet/eventlet/issues/270 https://github.com/eventlet/eventlet/issues/132
* Regenerate test crtOndřej Nový2018-08-222-28/+49
| | | | Newer OpenSSL requires RSA key at least 2048 bits
* contributing.mdAayush Kasurde2018-08-102-0/+111
|
* Add locals() call to example backdoor invocationAGSPhoenix2018-08-091-1/+1
|
* tests: Add ipv4 udp tests for greendnsLon Hohberger2018-08-081-0/+25
| | | | Signed-off-by: Lon Hohberger <lon@metamorphism.com>
* v0.24.1 releasev0.24.1Sergey Shepelev2018-08-062-1/+5
|
* greendns: don't contact nameservers if one entry is returned from hosts fileDaniel Alvarez2018-08-032-19/+83
| | | | | | | | | | | | | | getaddrinfo() behaves differently from the standard implementation as it will try to contact nameservers if only one (IPv4 or IPv6) entry is returned from /etc/hosts file. This patch avoids getaddrinfo() querying nameservers if at least one entry is fetched through the hosts file to match the behavior of the original socket.getaddrinfo() implementation. Closes #515 Signed-off-by: Daniel Alvarez <dalvarez@redhat.com>
* v0.24.0 releasev0.24.0Sergey Shepelev2018-08-012-1/+14
|
* tests: Add ipv6 tests for greendns udp() functionLon Hohberger2018-07-311-0/+41
| | | | | | | | | | | | Tests: - normal operation - no reply (timeout) - unexpected source address (w/ timeout & ignore_unexpected set) - number of zeroes in ipv6 address string different - unexpected address Signed-off-by: Lon Hohberger <lon@metamorphism.com>
* greendns udp: Fix infinite loop when source address mismatchLon Hohberger2018-07-311-3/+12
| | | | | | | | If the source address for a packet did not match where we sent, the udp() function would spin in an infinite loop and the timer would never expire, causing the process to hang. Signed-off-by: Lon Hohberger <lon@metamorphism.com>
* Fix bad ipv6 comparisonLon Hohberger2018-07-311-1/+11
| | | | | | | | | | When performing DNS lookups, the source address from resolv.conf may have stray zeroes in it, or the address string returned from socket.recvfrom may. Purge them before comparing tuples. Resolves: rhbz#1607967 Signed-off-by: Lon Hohberger <lon@metamorphism.com>
* website: link to PyPI project page w/o version; reflect current state of ↵Sergey Shepelev2018-07-282-32/+23
| | | | installation and development
* wsgi: Use byte strings on py2 and unicode strings on py3Tim Burke2018-07-252-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #488; for some additional context, see #468 and #467. PEP-0333 says [1] > all strings referred to in this specification **must** be of type ``str`` but muddied that message earlier with a bunch of talk about > all strings passed to or from the server must be standard Python byte > strings, not Unicode objects PEP-3333 sought to clarify [2] with > WSGI therefore defines two kinds of "string": > > * "Native" strings (which are always implemented using the type > named ``str``) that are used for request/response headers and > metadata > > * "Bytestrings" (which are implemented using the ``bytes`` type > in Python 3, and ``str`` elsewhere), that are used for the bodies > of requests and responses (e.g. POST/PUT input data and HTML page > outputs). > > Do not be confused however: even if Python's ``str`` type is actually > Unicode "under the hood", the *content* of native strings must > still be translatable to bytes via the Latin-1 encoding! And later, in "Unicode Issues" [3], it adds > For values referred to in this specification as "bytestrings" > (i.e., values read from ``wsgi.input``, passed to ``write()`` > or yielded by the application), the value **must** be of type > ``bytes`` under Python 3, and ``str`` in earlier versions of > Python. So the upshot seems to be - All request and response bodies must be bytes, regardless of Python version. - All headers and other WSGI environment keys need to be native strings; i.e. bytes strings on Python 2 and unicode strings on Python 3. [1] https://www.python.org/dev/peps/pep-0333/#unicode-issues [2] https://www.python.org/dev/peps/pep-3333/#a-note-on-string-types [3] https://www.python.org/dev/peps/pep-3333/#unicode-issues
* wsgi: Don't strip all Unicode whitespace from headers on py3 (#504)Tim Burke2018-07-062-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An application that wants to accept UTF-8 header values on Python 2 can do so fairly easily: since str is bytes, it can decode from UTF-8 directly and return appropriate errors if that decoding fails. On Python 3, it gets a little more interesting. Since str is unicode, the bytes-on-the-wire are decoded as Latin-1 before being put in the WSGI environment, so the application must encode as Latin-1 then decode as UTF-8. For the most part, this Just Works as the transformation should be lossless. Sometimes, however, headers get truncated on py3. This is the result of a difference in how .strip() behaves for bytes vs unicode -- in particular, there are some unicode characters that are considered whitespace whose Latin-1 encoded byte string is not: >>> [x for i in range(256) for x in (chr(i),) ... if x.isspace() and not x.encode('latin1').isspace()] ['\x1c', '\x1d', '\x1e', '\x1f', '\x85', '\xa0'] Looking at RFC 7230, it defines header fields as a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace where "whitespace" is limited to SP or HTAB. So, let's just strip *those* from header values. Note that (some versions of?) py2's mimetools.Message includes the trailing CRLF, so strip that, too. https://github.com/eventlet/eventlet/pull/504
* pools: put to empty pool would block sometimesSam Merritt2018-07-034-9/+73
| | | | | | | | | | | | | | | | | | | If you have a pool with no free items, one greenthread blocked in pool.get(), and then you call pool.put(item), sometimes the put will block. This happens when the greenthread blocked in pool.get() has a pending timeout. The timeout's timer has fired, the call to throw() has been scheduled, but throw() has not actually run yet. In pool.put(), we see a waiting getter, so we do a blocking self.channel.put()... but when the getter runs, it unwinds its stack and does not take the item, leaving the caller of pool.put() blocked despite there being enough free space. This commit fixes that by (a) making LightQueue.put() and .get() work with 0-length queues, even with timeouts, and (b) checking for queue.Full in Pool.put() and handling it correctly. https://github.com/eventlet/eventlet/pull/495
* greendns: resolving over TCP produced ValueErrorJaume Marhuenda2018-06-283-1/+106
|
* Drop support for Python3.3Sergey Shepelev2018-05-193-9/+3
|
* Drop support for Python2.6 and python-epoll packageSergey Shepelev2018-05-1915-124/+55
|
* support.greendns: ImportError when dns.rdtypes was imported before eventletJaume Marhuenda2018-05-143-0/+14
| | | https://github.com/eventlet/eventlet/issues/479
* external dependencies for six, monotonic, dnspythonnat-goodspeed2018-05-10159-16388/+86
|
* greendns: full comment lines were not skipped; Thanks to nat-goodspeednat-goodspeed2018-05-072-8/+14
| | | | | | | | | | | | `greendns.HostsResolver.LINES_RE` doesn't admit the possibility of a comment starting at the beginning of a line. This has been ignored since `is_ipv4_addr()` and `is_ipv6_addr()` catch `dns.exception.SyntaxError` and return `False`. But in a runtime environment that encounters #413, `dns.exception.SyntaxError` is not caught, and the import fails. Changing '+' to '*' allows `HostsResolver._readlines()` to recognize and skip comment lines. greendns.HostsResolver._readlines(), a purely internal method, now returns an itertools generator rather than a list. Change relevant asserts to build a list before comparing.
* v0.23.0 releasev0.23.0Sergey Shepelev2018-05-063-2/+8
|
* green.threading: current_thread() did not see new monkey-patched threads; ↵147-jakeSergey Shepelev2018-04-154-36/+62
| | | | | | Thanks to Jake Tesler https://github.com/eventlet/eventlet/issues/172
* tpool: exception in tpool-ed call leaked memory via backtraceJesse2018-03-113-0/+51
| | | | | | https://github.com/eventlet/eventlet/issues/469 https://github.com/eventlet/eventlet/pull/470 https://cosmicpercolator.com/2016/01/13/exception-leaks-in-python-2-and-3/
* typoSourabh Deshmukh2018-03-111-1/+1
| | | | https://github.com/sourabhdeshmukh/eventlet/pull/1
* wsgi: latin-1 encoding dance for environ[PATH_INFO]Sergey Shepelev2018-03-113-4/+33
| | | | | https://www.python.org/dev/peps/pep-0333/#unicode-issues https://github.com/eventlet/eventlet/issues/468
* travis: allow fail python 3.7 see issue ↵fix-psycoSergey Shepelev2018-03-101-6/+3
| | | | https://github.com/eventlet/eventlet/issues/475
* moved function eventlet.support.capture_stderr to testsSergey Shepelev2018-03-105-28/+23
|
* travis: update test dependencies, use psycopg2-binarySergey Shepelev2018-03-092-11/+13
|
* support: psycopg2_patcher import module, not functionSergey Shepelev2018-03-091-3/+3
|
* Add Python 3.6Hugo2018-03-091-0/+1
|
* v0.22.1 releasev0.22.1Sergey Shepelev2018-02-174-2/+10
|
* event: Event.wait() timeout=None argument to be compatible with upstream CPythonevent-wait-timeoutSergey Shepelev2018-01-142-14/+45
| | | | https://github.com/eventlet/eventlet/issues/402
* greendns: Treat /etc/hosts entries case-insensitiveRalf Haferkamp2018-01-132-1/+17
| | | | | | | | | Hostname in /etc/hosts are not case-sensitive, this fixes HostsResolver() accordingly. eventlet#458 Co-Authored-By: Thomas Bechtold <tbechtold@suse.com>
* v0.22.0 releasev0.22.0Sergey Shepelev2018-01-124-2/+35
|
* travis: crutch to get ipv6 backtravis-ipv6-fixSergey Shepelev2017-12-091-1/+3
|
* Travis broke ipv6, allow failure; test against Python 2.7Sergey Shepelev2017-12-055-13/+40
|
* websocket: fd leak when client did not close connection properlyKonstantin Enchant2017-12-041-6/+22
| | | | https://github.com/eventlet/eventlet/pull/450
* Avoid dependency on enum-compatJames Page2017-12-031-1/+1
| | | | Directly depend on enum34, scoping requirement to < Python 3.4.
* wsgi: handle remote connection resetsStefan Nica2017-11-071-1/+6
| | | | | | | | | | While processing a WSGI request, if the remote client forcefully resets the connection while the request data is being read from the socket (e.g. HAProxy health check), the ECONNRESET socket error is not properly handled and may end up being logged in strerr or in a log file. https://github.com/eventlet/eventlet/issues/446
* Drop OpenSSL.rand supportHaikel Guemar2017-10-044-4/+1
| | | | | | PyOpenSSL deprecated OpenSSL.rand in 17.2.0 and removed it in 17.3.0. To comply, update min version in tests to 17.3.0 and removes it. https://pyopenssl.org/en/stable/changelog.html
* websocket: support permessage-deflate extension; Thanks to Costas Christofi ↵costasgambit2017-09-113-20/+471
| | | | | | | and Peter Kovary Support for compression extension as described in RFC7692 https://tools.ietf.org/html/rfc7692 https://github.com/eventlet/eventlet/pull/417
* init: second workaround for monotonic "no suitable implementation"; Thanks ↵monotonic-401Sergey Shepelev2017-09-071-0/+8
| | | | | | | | | | to Geoffrey Thomas Force sooner find_library child process by early import monotonic. Helps with gunicorn and possibly other applications. https://github.com/eventlet/eventlet/issues/401 https://github.com/benoitc/gunicorn/issues/1584
* patcher: workaround for monotonic "no suitable implementation"patcher-gethub-401Geoffrey Thomas2017-08-262-0/+12
| | | | | | | | | | | | | | In some cases -- notably with Python 2.7.13 and the default hub -- the process of importing the hub involves calling code in a module we monkey-patch. This leads to recursive imports: the first eventlet function will call get_hub(), which will try to import the hub, which will call a monkey-patched module, which will call get_hub() and try to import the hub again. To avoid this, make sure the hub is fully imported before monkey-patching anything. https://github.com/eventlet/eventlet/issues/401
* greendns: early socket.timeout was breaking IO retry loopsdns-from-address-433Sergey Shepelev2017-08-251-15/+28
| | | | https://github.com/eventlet/eventlet/issues/433
* travis: codecov flags format was running `tr` with invalid argumentsSergey Shepelev2017-08-191-1/+1
|
* socket: context manager supportMiguel Grinberg2017-08-121-0/+6
| | | | Fixes #430
* convenience: (SO_REUSEPORT) socket.error is not OSError on Python 2; Thanks ↵reuseport-380Sergey Shepelev2017-07-291-1/+2
| | | | | | to JacoFourie@github https://github.com/eventlet/eventlet/issues/380
* support: upgrade bundled dnspython to 1.16.0 (22e9de1d7957e)dns-427Sergey Shepelev2017-07-2540-1691/+2191
| | | | https://github.com/eventlet/eventlet/issues/427
* dns: reading /etc/hosts raised DeprecationWarning for universal lines on ↵Chris Kerr2017-07-172-11/+30
| | | | | | | Python 3.4+ Solved by always reading in binary mode with explicit decoding. Plus: new hosts parser in regex, better comment handling.