buffet: Fix constant retries in XMPP on authorization failure

When XMPP channel is rejected due to invalid credentials, we did not
close the channel stream properly after server had sent "</stream:stream>
element which lead to numerous stream tear-down requests from the server.

Once we receive a stream closed request from the server, we must close
the actual stream/socket immediately.

BUG=brillo:1215
TEST=`FEATURES=test emerge-link buffet`
     Test on the device.

Change-Id: I924e72cd3e647bedf6e3138b55aed146259d52f1
Reviewed-on: https://chromium-review.googlesource.com/281392
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Trybot-Ready: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
2 files changed
tree: 7b26fdb31e6802491ebd7bcf68899ade765ab2a8
  1. buffet/