1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

fix: only send data once to the client

This commit is contained in:
Steffen Vogel 2016-02-04 17:49:45 +01:00
parent 8a578325c3
commit 79fa624c3e

View file

@ -248,7 +248,7 @@ found: * (void **) user = n;
if (w->shutdown)
goto shutdown;
if (!w->write.pool)
if (w->write.pool == NULL || w->write.cnt == 0)
return 0; /* no samples available to send */
pthread_mutex_lock(&w->write.mutex);
@ -274,6 +274,10 @@ found: * (void **) user = n;
memcpy(dst, src, bytes);
}
/* We've done our work here. Do not send again.. */
w->write.pool = NULL;
w->write.pool = 0;
pthread_mutex_unlock(&w->write.mutex);