Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3360,7 +3360,7 @@ _processUrlString(natsOptions *opts, const char *urls)
serverUrls = (char**) NATS_CALLOC(count + 1, sizeof(char*));
if (serverUrls == NULL)
return NATS_NO_MEMORY;

if (s == NATS_OK)
{
urlsCopy = NATS_STRDUP(urls);
Expand Down
26 changes: 15 additions & 11 deletions src/js.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,19 +842,23 @@ _timeoutPubAsync(natsTimer *t, void *closure)

while (((pm = js->pmHead) != NULL) && (pm->deadline <= now))
{
natsMsg *m = NULL;

if (natsMsg_Create(&m, pm->subject, NULL, NULL, 0) != NATS_OK)
break;

natsMsg_setTimeout(m);
// Check if the corresponding message is still in the hashtable.
char *id = (pm->subject+js->rpreLen);
if (natsStrHash_Get(js->pm, id) != NULL)
Comment thread
derekcollison marked this conversation as resolved.
{
natsMsg *m = NULL;

// Best attempt, ignore NATS_SLOW_CONSUMER errors which may be returned
// here.
nats_lockSubAndDispatcher(js->rsub);
natsSub_enqueueUserMessage(js->rsub, m);
nats_unlockSubAndDispatcher(js->rsub);
if (natsMsg_Create(&m, pm->subject, NULL, NULL, 0) == NATS_OK)
{
natsMsg_setTimeout(m);

// Best attempt, ignore NATS_SLOW_CONSUMER errors which may be returned here.
nats_lockSubAndDispatcher(js->rsub);
natsSub_enqueueUserMessage(js->rsub, m);
nats_unlockSubAndDispatcher(js->rsub);
}
}
// Remove from the list.
js->pmHead = pm->next;
_destroyPMInfo(pm);
}
Expand Down