We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 44247fe commit 6b7f354Copy full SHA for 6b7f354
1 file changed
src/AsyncSocket.h
@@ -347,7 +347,17 @@ struct AsyncSocket {
347
loopData->corkOffset = 0;
348
349
if (failed) {
350
- /* We do not need to care for buffering here, write does that */
+ /* If corked data fails to flush, and we have more data to write, immediately buffer it here
351
+ * since the above call to write excludes src */
352
+ if (!optionally && src && length) {
353
+ AsyncSocketData<SSL> *asyncSocketData = getAsyncSocketData();
354
+ asyncSocketData->buffer.append(src, (size_t) length);
355
+
356
+ /* We wrote to per socket buffer, so report success */
357
+ return {length, true};
358
+ }
359
360
+ /* We do not need to care for buffering (of the corked data) here, write did that */
361
return {0, true};
362
}
363
0 commit comments