| 353 | * to our sub-slaves. */ |
| 354 | #include <ctype.h> |
| 355 | void replicationFeedSlavesFromMasterStream(list *slaves, char *buf, size_t buflen) { |
| 356 | listNode *ln; |
| 357 | listIter li; |
| 358 | |
| 359 | /* Debugging: this is handy to see the stream sent from master |
| 360 | * to slaves. Disabled with if(0). */ |
| 361 | if (0) { |
| 362 | printf("%zu:",buflen); |
| 363 | for (size_t j = 0; j < buflen; j++) { |
| 364 | printf("%c", isprint(buf[j]) ? buf[j] : '.'); |
| 365 | } |
| 366 | printf("\n"); |
| 367 | } |
| 368 | |
| 369 | if (server.repl_backlog) feedReplicationBacklog(buf,buflen); |
| 370 | listRewind(slaves,&li); |
| 371 | while((ln = listNext(&li))) { |
| 372 | client *slave = ln->value; |
| 373 | |
| 374 | if (!canFeedReplicaReplBuffer(slave)) continue; |
| 375 | addReplyProto(slave,buf,buflen); |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | void replicationFeedMonitors(client *c, list *monitors, int dictid, robj **argv, int argc) { |
| 380 | if (!(listLength(server.monitors) && !server.loading)) return; |
no test coverage detected