Control: tag -1 confirmed Hi Thomas,
A couple of comments on the diff below, otherwise fine to go ahead. On Fri, Sep 10, 2021 at 09:50:25PM +0200, Thomas Goirand wrote: > diff -Nru python-eventlet-0.26.1/debian/greendns.orig.py > python-eventlet-0.26.1/debian/greendns.orig.py > --- python-eventlet-0.26.1/debian/greendns.orig.py 2021-05-11 > 08:03:43.000000000 +0200 > +++ python-eventlet-0.26.1/debian/greendns.orig.py 2021-09-10 > 21:42:12.000000000 +0200 That looks odd, this file probably shouldn't be there? [...] > diff -Nru python-eventlet-0.26.1/debian/greendns.py > python-eventlet-0.26.1/debian/greendns.py > --- python-eventlet-0.26.1/debian/greendns.py 2021-05-11 08:03:43.000000000 > +0200 > +++ python-eventlet-0.26.1/debian/greendns.py 2021-09-10 21:42:12.000000000 > +0200 [...] > def tcp(q, where, timeout=DNS_QUERY_TIMEOUT, port=53, > @@ -794,7 +834,19 @@ > @type source: string > @param source_port: The port from which to send the message. > The default is 0. > - @type source_port: int""" > + @type source_port: int > + @type ignore_unexpected: bool > + @param one_rr_per_rrset: If True, put each RR into its own > + RRset. > + @type one_rr_per_rrset: bool > + @param ignore_trailing: If True, ignore trailing > + junk at end of the received message. > + @type ignore_trailing: bool > + @param sock: the socket to use for the > + query. If None, the default, a socket is created. Note that > + if a socket is provided, it must be a nonblocking datagram socket, > + and the source and source_port are ignored. > + @type sock: socket.socket | None""" > > wire = q.to_wire() > if af is None: The doc for sock here looks like a copy/paste error from the udp case, and should be a TCP socket instead. Looks like https://github.com/eventlet/eventlet/blob/master/eventlet/support/greendns.py#L861 still has it wrong. > @@ -810,7 +862,10 @@ > destination = (where, port, 0, 0) > if source is not None: > source = (source, source_port, 0, 0) > - s = socket.socket(af, socket.SOCK_STREAM) > + if sock: > + s = sock > + else: > + s = socket.socket(af, socket.SOCK_STREAM) > s.settimeout(timeout) > try: > expiration = compute_expiration(dns.query, timeout) Cheers, Julien