Skip to content

Commit 8ab74c0

Browse files
author
Ian Craggs
committed
Fix for issue eclipse-paho#20
1 parent 53b949d commit 8ab74c0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/SocketBuffer.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
*
44
* All rights reserved. This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License v1.0
6-
* and Eclipse Distribution License v1.0 which accompany this distribution.
6+
* and Eclipse Distribution License v1.0 which accompany this distribution.
77
*
8-
* The Eclipse Public License is available at
8+
* The Eclipse Public License is available at
99
* http://www.eclipse.org/legal/epl-v10.html
10-
* and the Eclipse Distribution License is available at
10+
* and the Eclipse Distribution License is available at
1111
* http://www.eclipse.org/org/documents/edl-v10.php.
1212
*
1313
* Contributors:
1414
* Ian Craggs - initial API and implementation and/or initial documentation
1515
* Ian Craggs, Allan Stockdill-Mander - SSL updates
16-
* Ian Craggs - fix for issue #244
16+
* Ian Craggs - fix for issue #244, issue #20
1717
*******************************************************************************/
1818

1919
/**
@@ -133,6 +133,7 @@ void SocketBuffer_terminate(void)
133133
void SocketBuffer_cleanup(int socket)
134134
{
135135
FUNC_ENTRY;
136+
SocketBuffer_writeComplete(socket); /* clean up write buffers */
136137
if (ListFindItem(queues, &socket, socketcompare))
137138
{
138139
free(((socket_queue*)(queues->current->content))->buf);
@@ -239,9 +240,9 @@ void SocketBuffer_interrupted(int socket, size_t actual_len)
239240
queue = def_queue;
240241
/* if SocketBuffer_queueChar() has not yet been called, then the socket number
241242
in def_queue will not have been set. Issue #244.
242-
If actual_len == 0 then we may not need to do anything - I'll leave that
243+
If actual_len == 0 then we may not need to do anything - I'll leave that
243244
optimization for another time. */
244-
queue->socket = socket;
245+
queue->socket = socket;
245246
ListAppend(queues, def_queue, sizeof(socket_queue)+def_queue->buflen);
246247
SocketBuffer_newDefQ();
247248
}

0 commit comments

Comments
 (0)