| 525 | } |
| 526 | |
| 527 | static int writeProtoNum(char *dst, const size_t cchdst, long long num) |
| 528 | { |
| 529 | if (cchdst < 1) |
| 530 | return 0; |
| 531 | dst[0] = '$'; |
| 532 | int cch = 1; |
| 533 | cch += ll2string(dst + cch, cchdst - cch, digits10(num)); |
| 534 | int chCpyT = std::min<int>(cchdst - cch, 2); |
| 535 | memcpy(dst + cch, "\r\n", chCpyT); |
| 536 | cch += chCpyT; |
| 537 | cch += ll2string(dst + cch, cchdst-cch, num); |
| 538 | chCpyT = std::min<int>(cchdst - cch, 3); |
| 539 | memcpy(dst + cch, "\r\n", chCpyT); |
| 540 | if (chCpyT == 3) |
| 541 | cch += 2; |
| 542 | else |
| 543 | cch += chCpyT; |
| 544 | return cch; |
| 545 | } |
| 546 | |
| 547 | int canFeedReplicaReplBuffer(client *replica) { |
| 548 | /* Don't feed replicas that only want the RDB. */ |
no test coverage detected