Skip to content

Commit

Permalink
Fixed issue #2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeroen van der Heijden committed Oct 22, 2016
1 parent ec0e3fc commit db56921
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
6 changes: 5 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
2016.10.22, Version 2.0.3 (BETA)

- Fixed handling authentication errors correctly. (issue #2)

2016.10.21, Version 2.0.2 (BETA)

- Added is_closed property to client.
- New and closed connections logging is set from info to debug
- New and closed connections logging is set from info to debug. (issue #1)

2016.10.03, Version 2.0.1 (BETA)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from distutils.core import setup
import setuptools

VERSION = '2.0.2'
VERSION = '2.0.3'

setup(
name='siridb-connector',
Expand Down
3 changes: 1 addition & 2 deletions siridb/connector/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from .lib.client import SiriDBClient


__version_info__ = (2, 0, 2)
__version_info__ = (2, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
__maintainer__ = 'Jeroen van der Heijden'
__email__ = '[email protected]'
Expand All @@ -20,7 +20,6 @@
'SiriDBProtocol',
]


class SiriDBProtocol(_SiriDBProtocol):

def on_connection_made(self):
Expand Down
4 changes: 1 addition & 3 deletions siridb/connector/lib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,11 @@ def _log_connect_result(result):
for r in result:
if r:
logging.error(r)
if isinstance(r, (IndexError, AuthenticationError)):
break

async def connect(self, timeout=None):
self._retry_connect = True
result = await self._connect(timeout)
if result and set(result) - {None}:
if result and set(result) - {None} and self._connect_task is None:
self._connect_task = asyncio.ensure_future(self._connect_loop())
return result

Expand Down
7 changes: 6 additions & 1 deletion siridb/connector/lib/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ def connection_made(self, transport):
override asyncio.Protocol
'''
def finished(future):
if not future.exception():
exc = future.exception()
if not exc:
self.on_authenticated()
else:
logging.debug('Authentication failed: {}'.format(exc))
self.transport.close()


self._connected = True
self.transport = transport
Expand Down

0 comments on commit db56921

Please sign in to comment.