Skip to content

Commit

Permalink
fixes nanomsg#997 Windows IPC Assertion failed: !self->pipesendbuf
Browse files Browse the repository at this point in the history
  • Loading branch information
gdamore committed Nov 22, 2018
1 parent 1749fd7 commit e40de97
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/aio/usock_win.inc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ void nn_usock_accept (struct nn_usock *self, struct nn_usock *listener)
int rc;
BOOL brc;
DWORD nbytes;

/* NamedPipes have their own accepting mechanism. */
if (listener->domain == AF_UNIX) {
nn_usock_accept_pipe (self, listener);
Expand Down Expand Up @@ -403,7 +403,7 @@ void nn_usock_send (struct nn_usock *self, const struct nn_iovec *iov,
memset (&self->out.olpd, 0, sizeof (self->out.olpd));
if (self->domain == AF_UNIX)
{
/* TODO: Do not copy the buffer, find an efficent way to Write
/* TODO: Do not copy the buffer, find an efficent way to Write
multiple buffers that doesn't affect the state machine. */

/* Ensure the total buffer size does not exceed size limitation
Expand Down Expand Up @@ -910,6 +910,10 @@ static void nn_usock_handler (struct nn_fsm *self, int src, int type,
return;
case NN_WORKER_OP_ERROR:
if (nn_usock_cancel_io (usock) == 0) {
if (usock->pipesendbuf) {
nn_free(usock->pipesendbuf);
usock->pipesendbuf = NULL;
}
nn_fsm_raise(&usock->fsm, &usock->event_error,
NN_USOCK_ERROR);
nn_usock_close(usock);
Expand Down

0 comments on commit e40de97

Please sign in to comment.