diff --git a/README.md b/README.md index 37be86d..23aec31 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ If you want to test it, do this. Otherwise scroll down for instructions on how t ### Changelog +- v0.2.1 + - Fix partial send of outbound packets [#8](https://github.com/localstack/postgresql-proxy/pull/8) - v0.2.0 - Add support for intercepting [ParameterStatus](https://www.postgresql.org/docs/current/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-PARAMETERSTATUS) responses from Postgres [#7](https://github.com/localstack/postgresql-proxy/pull/7) - v0.1.2 @@ -74,4 +76,4 @@ If you want to test it, do this. Otherwise scroll down for instructions on how t - v0.0.3 - add stop() method to proxy; refactor logging - v0.0.2 - - fix socket file descriptors under Linux \ No newline at end of file + - fix socket file descriptors under Linux diff --git a/postgresql_proxy/proxy.py b/postgresql_proxy/proxy.py index 2cb6c39..1417db9 100644 --- a/postgresql_proxy/proxy.py +++ b/postgresql_proxy/proxy.py @@ -181,9 +181,10 @@ def service_connection(self, key: SelectorKeyProxy, mask): next_conn = conn.redirect_conn if next_conn and next_conn.out_bytes: try: - LOG.debug('sending to %s:\n%s', next_conn.name, next_conn.out_bytes) - sent = next_conn.sock.send(next_conn.out_bytes) - next_conn.sent(sent) + while next_conn.out_bytes: + LOG.debug('sending to %s:\n%s', next_conn.name, next_conn.out_bytes) + sent = next_conn.sock.send(next_conn.out_bytes) + next_conn.sent(sent) except OSError: # If one side is closed, close the other one # this can happen in the case where the client disconnects, and postgres still return a response diff --git a/setup.py b/setup.py index cf77305..941180e 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name='postgresql-proxy', - version='0.2.0', + version='0.2.1', description='Postgresql Proxy', packages=find_packages(exclude=('tests', 'tests.*')), install_requires=install_requires,