e,
)
self.ws_data = try_http(data, self.sock.fileno(), e)
- self.write() # TODO this is a hack
+ # this `write` is a hack - writing _ought_ to be done at the
+ # stage when all other writes are performed. But I could not
+ # arrange it so in a logical way. Let it stay this way. The
+ # whole http server affair is a hack anyway.
+ self.write()
log.debug("Sending HTTP response to %d", self.sock.fileno())
msgs = None
else:
global htmlfile
initdb(conf.get("storage", "dbfn"))
- htmlfile = conf.get("wsgateway", "htmlfile")
+ htmlfile = conf.get("wsgateway", "htmlfile", fallback=None)
# Is this https://github.com/zeromq/pyzmq/issues/1627 still not fixed?!
zctx = zmq.Context() # type: ignore
zsub = zctx.socket(zmq.SUB) # type: ignore
towait &= trywrite
towait |= morewait
except KeyboardInterrupt:
- pass
+ zsub.close()
+ zctx.destroy() # type: ignore
+ tcpl.close()
if __name__.endswith("__main__"):