allow streaming to work
Costa Tsaousis (ktsaou) committed
Jan 16, 2018 at 00:58 UTC
c3177bcae47327375fffcc881b0f3f1e3205d7fd
1 file changed
+8
-5
src/socket.c
+8
-5
@@ -1277,7 +1277,7 @@ static void poll_events_process(POLLJOB *p, POLLINFO *pi, struct pollfd *pf, sho
1277
1278
#ifdef NETDATA_INTERNAL_CHECKS
1279
// this is common - it is used for web server file copies
1280
- if(!(pf->events & (POLLIN|POLLOUT))) {
1280
+ if(unlikely(!(pf->events & (POLLIN|POLLOUT)))) {
1281
error("POLLFD: LISTENER: after reading, client slot %zu (fd %d) from '%s:%s' was left without expecting input or output. ", i, fd, pi->client_ip?pi->client_ip:"<undefined-ip>", pi->client_port?pi->client_port:"<undefined-port>");
1282
//poll_close_fd(pi);
1283
//return;
@@ -1299,11 +1299,14 @@ static void poll_events_process(POLLJOB *p, POLLINFO *pi, struct pollfd *pf, sho
1299
return;
1300
}
1301
1302
+#ifdef NETDATA_INTERNAL_CHECKS
1303
+ // this is common - it is used for streaming
1304
if(unlikely(pi->flags & POLLINFO_FLAG_CLIENT_SOCKET && !(pf->events & (POLLIN|POLLOUT)))) {
1303
- error("POLLFD: LISTENER: after sending, client slot %zu (fd %d) from '%s:%s' was left without expecting input or output - closing it. ", i, fd, pi->client_ip?pi->client_ip:"<undefined-ip>", pi->client_port?pi->client_port:"<undefined-port>");
1304
- poll_close_fd(pi);
1305
- return;
1305
+ error("POLLFD: LISTENER: after sending, client slot %zu (fd %d) from '%s:%s' was left without expecting input or output. ", i, fd, pi->client_ip?pi->client_ip:"<undefined-ip>", pi->client_port?pi->client_port:"<undefined-port>");
1306
+ //poll_close_fd(pi);
1307
+ //return;
1308
}
1309
+#endif
1310
}
1311
1312
if(unlikely(revents & POLLERR)) {
@@ -1409,7 +1412,7 @@ void poll_events(LISTEN_SOCKETS *sockets
1412
}
1413
}
1414
1412
- if(now - last_check > p.checks_every) {
1415
+ if(unlikely(now - last_check > p.checks_every)) {
1416
last_check = now;
1417
1418
// security checks