diff --git a/LICENSE b/LICENSE index 91e36a8b854719bfddb4745db2781802549f158a..2de3c57289278fc1322dc362178010d4e775e290 100644 --- a/LICENSE +++ b/LICENSE @@ -22,4 +22,4 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -resources/*: consult each file for respective copyright holders \ No newline at end of file +resources/*: consult each file for respective copyright holders diff --git a/coolamqp/uplink/connection/connection.py b/coolamqp/uplink/connection/connection.py index 78f5e073cb8d93ae5f6423ec734087f258a27621..0083a3cbc5730497fe7aaf3773f2fb9edf1b79ee 100644 --- a/coolamqp/uplink/connection/connection.py +++ b/coolamqp/uplink/connection/connection.py @@ -176,11 +176,15 @@ class Connection(object): self.watch_for_method(0, (ConnectionClose, ConnectionCloseOk), self.on_connection_close) - self.sendf = SendingFramer(self.listener_socket.send) - Handshaker(self, self.node_definition, self.on_connected, self.extra_properties) + # Note that these are placed in just the right order. Sometimes there would + # be a race condition that ConnectionStart has arrived before there could + # be a watch for it set self.listener_socket = self.listener_thread.register(sock, on_read=self.recvf.put, on_fail=self.on_fail) + self.sendf = SendingFramer(self.listener_socket.send) + Handshaker(self, self.node_definition, self.on_connected, self.extra_properties) + self.listener_thread.activate(self.listener_socket) def on_fail(self): """ diff --git a/coolamqp/uplink/handshake.py b/coolamqp/uplink/handshake.py index 1b3526d78b67418d58eff07824d4cd2458e59b62..7724202c29b5bf32ff8af0f120298f433436a507 100644 --- a/coolamqp/uplink/handshake.py +++ b/coolamqp/uplink/handshake.py @@ -25,7 +25,7 @@ CLIENT_DATA = [ # because RabbitMQ is some kind of a fascist and does not allow # these fields to be of type short-string (b'product', (b'CoolAMQP', 'S')), - (b'version', (b'0.100a1', 'S')), + (b'version', (b'0.100', 'S')), (b'copyright', (b'Copyright (C) 2016-2020 SMOK sp. z o.o.', 'S')), ( b'information', ( diff --git a/coolamqp/uplink/listener/epoll_listener.py b/coolamqp/uplink/listener/epoll_listener.py index 1a42b7129bc47499c9c647a028caeb5859a0a33b..796adc3e25d3f05763b1467091308deef3a1c1a2 100644 --- a/coolamqp/uplink/listener/epoll_listener.py +++ b/coolamqp/uplink/listener/epoll_listener.py @@ -137,6 +137,9 @@ class EpollListener(object): callback )) + def activate(self, sock): # type: (coolamqp.uplink.listener.epoll_listener.EpollSocket) -> None + self.epoll.register(sock.sock, RW) + def register(self, sock, on_read=lambda data: None, on_fail=lambda: None): """ @@ -151,5 +154,4 @@ class EpollListener(object): sock = EpollSocket(sock, on_read, on_fail, self) self.fd_to_sock[sock.fileno()] = sock - self.epoll.register(sock, RW) return sock diff --git a/docs/conf.py b/docs/conf.py index 5333e6afda313a75badcac420a58458d8bf32424..a087dcf22e631395ec3acc81d6e989fa098f31ce 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,7 +57,7 @@ author = u'DMS Serwis s.c.' # The short X.Y version. version = '0.100' # The full version, including alpha/beta/rc tags. -release = u'0.100a1' +release = u'0.100' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/setup.cfg b/setup.cfg index 70fafaf4a2ef1e1fc81742ab4517c4a5cd84e960..caac9505a533961f5d1510be7d39003fa949b740 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,7 +1,7 @@ [metadata] description-file = README.md name = CoolAMQP -version = 0.100a1 +version = 0.100 license = MIT License classifiers = Programming Language :: Python