properly initialize stream receiving thread
Costa Tsaousis (ktsaou) committed
Feb 23, 2017 at 19:56 UTC
5f8481847429225f60829f211b16c2db26337ee1
1 file changed
+1
-4
src/rrdpush.c
+1
-4
@@ -609,18 +609,15 @@ int rrdpush_receiver_thread_spawn(RRDHOST *host, struct web_client *w, char *url
609
rpt->update_every = update_every;
610
611
pthread_t *thread = mallocz(sizeof(pthread_t));
612
- pthread_attr_t attr;
612
613
debug(D_SYSTEM, "Starting STREAM thread for client [%s]:%s.", w->client_ip, w->client_port);
614
616
- if(pthread_create(thread, &attr, rrdpush_receiver_thread, rpt))
615
+ if(pthread_create(thread, NULL, rrdpush_receiver_thread, (void *)rpt))
616
error("failed to create new STREAM thread for client [%s]:%s.", w->client_ip, w->client_port);
617
618
else if(pthread_detach(*thread))
619
error("Cannot request detach newly created thread for client [%s]:%s.", w->client_ip, w->client_port);
620
622
- rrdpush_receive(w->ifd, key, hostname, machine_guid, os, update_every, w->client_ip, w->client_port);
623
-
621
// prevent the caller from closing the streaming socket
622
if(w->ifd == w->ofd)
623
w->ifd = w->ofd = -1;