فهرست منبع

Ignore messages from unknown channels.

It occasionally happens that messages on a channel are received before
the subscription confirmation, which would cause a panic when looking
for the subscription.

Changed to simply ignore those.
Paul Lietar 9 سال پیش
والد
کامیت
5464647164
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/mercury.rs

+ 2 - 2
src/mercury.rs

@@ -147,8 +147,8 @@ impl MercuryManager {
             MercuryCallback::Subscription(tx) => self.complete_subscription(response, tx),
             MercuryCallback::Channel => {
                 self.subscriptions
-                    .get(header.get_uri()).unwrap()
-                    .send(response).unwrap()
+                    .get(header.get_uri())
+                    .map(|tx| tx.send(response).unwrap());
             }
         }
     }