Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jsonrpclib/SimpleJSONRPCServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,15 @@ def do_POST(self):
L = []
while size_remaining:
chunk_size = min(size_remaining, max_chunk_size)
L.append(self.rfile.read(chunk_size))
content_read = self.rfile.read(chunk_size)
if (content_read):
L.append(content_read)
else:
logging.warn("0 bytes was read from the socket "
"indicating the peer has performed a "
"shutdown. Close the socket and return.")
self.connection.shutdown(1)
return
size_remaining -= len(L[-1])
data = ''.join(L)
response = self.server._marshaled_dispatch(data)
Expand Down