From 8ab74c01b42f5d0bd187aaa7e103b64e01c03a22 Mon Sep 17 00:00:00 2001 From: Ian Craggs Date: Wed, 19 Jul 2017 16:05:50 +0100 Subject: [PATCH] Fix for issue #20 --- src/SocketBuffer.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/SocketBuffer.c b/src/SocketBuffer.c index 14ec3474..de145c8e 100644 --- a/src/SocketBuffer.c +++ b/src/SocketBuffer.c @@ -3,17 +3,17 @@ * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 - * and Eclipse Distribution License v1.0 which accompany this distribution. + * and Eclipse Distribution License v1.0 which accompany this distribution. * - * The Eclipse Public License is available at + * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html - * and the Eclipse Distribution License is available at + * and the Eclipse Distribution License is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * Contributors: * Ian Craggs - initial API and implementation and/or initial documentation * Ian Craggs, Allan Stockdill-Mander - SSL updates - * Ian Craggs - fix for issue #244 + * Ian Craggs - fix for issue #244, issue #20 *******************************************************************************/ /** @@ -133,6 +133,7 @@ void SocketBuffer_terminate(void) void SocketBuffer_cleanup(int socket) { FUNC_ENTRY; + SocketBuffer_writeComplete(socket); /* clean up write buffers */ if (ListFindItem(queues, &socket, socketcompare)) { free(((socket_queue*)(queues->current->content))->buf); @@ -239,9 +240,9 @@ void SocketBuffer_interrupted(int socket, size_t actual_len) queue = def_queue; /* if SocketBuffer_queueChar() has not yet been called, then the socket number in def_queue will not have been set. Issue #244. - If actual_len == 0 then we may not need to do anything - I'll leave that + If actual_len == 0 then we may not need to do anything - I'll leave that optimization for another time. */ - queue->socket = socket; + queue->socket = socket; ListAppend(queues, def_queue, sizeof(socket_queue)+def_queue->buflen); SocketBuffer_newDefQ(); }