apcera/gnatsd — pull request #51 by zrob (2014-09-19 05:39:28+00:00)
Title: Retry: Fix subscription sharing/route reconnect race that causes some clients not to receive messages

Replaces #49 b/c I need that branch without force push

No longer add subscriptions to router clients with no existing connection.

race condition:
- a client is closed at the same time as an incoming SUB message occurs.
- the subscription is added to the srv.sl even though the socket is
closed.
- the connection cleanup has already run, so the bad state is never
corrected
- now messages may be forwarded to a client without a connection
- messages will not be forwarded to a router that needs it now, because
processMsg assumes the router already received it