From 523fa46a094f61f95b01cfc4a2b5b42856bef97f Mon Sep 17 00:00:00 2001 From: Paolo Invernizzi Date: Fri, 25 Oct 2019 13:52:28 +0200 Subject: [PATCH] not always socket.receive fills the buffer argument --- source/ddb/postgres.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/ddb/postgres.d b/source/ddb/postgres.d index 7aaad4d..3a15320 100644 --- a/source/ddb/postgres.d +++ b/source/ddb/postgres.d @@ -225,7 +225,10 @@ class PGStream { if (buffer.length > 0) { - m_socket.receive(buffer); + ptrdiff_t so_far = 0; + do { + so_far += m_socket.receive(buffer[so_far .. $]); + } while (so_far < buffer.length); } } }