qzind / qz-print

Archive for legacy qz-print versions (1.8, 1.9). See https://github.com/qzind/tray for modern versions.
Other
141 stars 101 forks source link

Backport synchronous sends patch #191

Closed tresf closed 8 years ago

tresf commented 8 years ago

There was a patch to 2.0 which helped synchronize the sends to avoid the Blocking message pending 10000 for BLOCKING message.

https://github.com/qzind/tray/commit/a6e71e92dcd46fef40d6e34110a7e3a240e7e4b6

This fix should be evaluated and ported to 1.9 if applicable.

-    private static void send(Session session, JSONObject reply) {
+    private static synchronized void send(Session session, JSONObject reply) {
         try {
             session.getRemote().sendString(reply.toString());
         }
-        catch(WebSocketException e) {
+        catch(Exception e) {
             log.error("Could not send message", e);
         }
-        catch(IOException e) {
-            log.error("Send failed", e);
-        }
     }
akberenz commented 8 years ago

Backported in fdbfff48ab4e792a3170fb4b764575788486becf It looks like the catch all block was already there, so this doesn't seem like the cause behind the client needing to reload the software.

tresf commented 8 years ago

Closed via fdbfff4.