Browse Source

Merge branch 'release-0.7.20'

master 0.7.20
Neil Booth 8 years ago
parent
commit
8d9a5c4ff2
  1. 6
      RELEASE-NOTES
  2. 2
      electrumx_server.py
  3. 7
      lib/jsonrpc.py
  4. 2
      server/protocol.py
  5. 2
      server/version.py

6
RELEASE-NOTES

@ -1,3 +1,9 @@
version 0.7.20
--------------
- fix for errors during batch requests (issue #54)
- don't log errors on shutdown after giving sockets time to close
version 0.7.19
--------------

2
electrumx_server.py

@ -41,7 +41,7 @@ def main_loop():
def on_exception(loop, context):
'''Suppress spurious messages it appears we cannot control.'''
message = context.get('message')
if not message in SUPPRESS_MESSAGES:
if not loop.is_closed() and not message in SUPPRESS_MESSAGES:
if not ('task' in context and
'accept_connection2()' in repr(context.get('task'))):
loop.default_exception_handler(context)

7
lib/jsonrpc.py

@ -211,16 +211,17 @@ class JSONRPC(asyncio.Protocol, LoggedClass):
if self.transport.is_closing():
return
id_ = payload.get('id') if isinstance(payload, dict) else None
try:
data = (json.dumps(payload) + '\n').encode()
except TypeError:
msg = 'JSON encoding failure: {}'.format(payload)
self.logger.error(msg)
self.send_json_error(msg, self.INTERNAL_ERROR, payload.get('id'))
self.send_json_error(msg, self.INTERNAL_ERROR, id_)
else:
if len(data) > max(1000, self.max_send):
self.send_json_error('request too large', self.INVALID_REQUEST,
payload.get('id'))
self.send_json_error('request too large',
self.INVALID_REQUEST, id_)
raise self.LargeRequestError
else:
self.send_count += 1

2
server/protocol.py

@ -341,7 +341,7 @@ class ServerManager(util.LoggedClass):
if self.sessions:
await self.close_sessions()
async def close_sessions(self, secs=60):
async def close_sessions(self, secs=30):
self.logger.info('cleanly closing client sessions, please wait...')
for session in self.sessions:
self.close_session(session)

2
server/version.py

@ -1 +1 @@
VERSION = "ElectrumX 0.7.19"
VERSION = "ElectrumX 0.7.20"

Loading…
Cancel
Save