| 453 | } |
| 454 | |
| 455 | static void setClusterKeyHashTag(client c) { |
| 456 | assert(c->thread_id >= 0); |
| 457 | clusterNode *node = c->cluster_node; |
| 458 | assert(node); |
| 459 | assert(node->current_slot_index < node->slots_count); |
| 460 | int is_updating_slots = 0; |
| 461 | atomicGet(config.is_updating_slots, is_updating_slots); |
| 462 | /* If updateClusterSlotsConfiguration is updating the slots array, |
| 463 | * call updateClusterSlotsConfiguration is order to block the thread |
| 464 | * since the mutex is locked. When the slots will be updated by the |
| 465 | * thread that's actually performing the update, the execution of |
| 466 | * updateClusterSlotsConfiguration won't actually do anything, since |
| 467 | * the updated_slots_count array will be already NULL. */ |
| 468 | if (is_updating_slots) updateClusterSlotsConfiguration(); |
| 469 | int slot = node->slots[node->current_slot_index]; |
| 470 | const char *tag = crc16_slot_table[slot]; |
| 471 | int taglen = strlen(tag); |
| 472 | size_t i; |
| 473 | for (i = 0; i < c->staglen; i++) { |
| 474 | char *p = c->stagptr[i] + 1; |
| 475 | p[0] = tag[0]; |
| 476 | p[1] = (taglen >= 2 ? tag[1] : '}'); |
| 477 | p[2] = (taglen == 3 ? tag[2] : '}'); |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | static void clientDone(client c) { |
| 482 | int requests_finished = 0; |
no test coverage detected