Lines Matching refs:reply

512     redisReply *reply = redisCommand(context, "COMMAND");  in cliIntegrateHelp()  local
513 if(reply == NULL || reply->type != REDIS_REPLY_ARRAY) return; in cliIntegrateHelp()
517 for (size_t j = 0; j < reply->elements; j++) { in cliIntegrateHelp()
518 redisReply *entry = reply->element[j]; in cliIntegrateHelp()
561 freeReplyObject(reply); in cliIntegrateHelp()
726 redisReply *reply; in cliAuth() local
729 reply = redisCommand(context,"AUTH %s",config.auth); in cliAuth()
730 if (reply != NULL) { in cliAuth()
731 freeReplyObject(reply); in cliAuth()
739 redisReply *reply; in cliSelect() local
742 reply = redisCommand(context,"SELECT %d",config.dbnum); in cliSelect()
743 if (reply != NULL) { in cliSelect()
745 if (reply->type == REDIS_REPLY_ERROR) result = REDIS_ERR; in cliSelect()
746 freeReplyObject(reply); in cliSelect()
1003 redisReply *reply; in cliReadReply() local
1026 reply = (redisReply*)_reply; in cliReadReply()
1028 config.last_cmd_type = reply->type; in cliReadReply()
1032 if (config.cluster_mode && reply->type == REDIS_REPLY_ERROR && in cliReadReply()
1033 (!strncmp(reply->str,"MOVED",5) || !strcmp(reply->str,"ASK"))) in cliReadReply()
1035 char *p = reply->str, *s; in cliReadReply()
1062 out = cliFormatReplyRaw(reply); in cliReadReply()
1065 out = cliFormatReplyRaw(reply); in cliReadReply()
1068 out = cliFormatReplyTTY(reply,""); in cliReadReply()
1070 out = cliFormatReplyCSV(reply); in cliReadReply()
1077 freeReplyObject(reply); in cliReadReply()
1192 redisReply *reply = NULL; in reconnectingRedisCommand() local
1197 while(reply == NULL) { in reconnectingRedisCommand()
1209 reply = redisvCommand(c,fmt,ap); in reconnectingRedisCommand()
1221 return reply; in reconnectingRedisCommand()
1847 redisReply *reply = redisCommand(context, in evalMode() local
1850 if (reply) freeReplyObject(reply); in evalMode()
1955 typedef int (*clusterManagerOnReplyError)(redisReply *reply, int bulk_idx);
2220 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, "MULTI"); in clusterManagerStartTransaction() local
2221 int success = clusterManagerCheckRedisReply(node, reply, NULL); in clusterManagerStartTransaction()
2222 if (reply) freeReplyObject(reply); in clusterManagerStartTransaction()
2230 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, "EXEC"); in clusterManagerExecTransaction() local
2231 int success = clusterManagerCheckRedisReply(node, reply, NULL); in clusterManagerExecTransaction()
2233 if (reply->type != REDIS_REPLY_ARRAY) { in clusterManagerExecTransaction()
2238 for (i = 0; i < reply->elements; i++) { in clusterManagerExecTransaction()
2239 redisReply *r = reply->element[i]; in clusterManagerExecTransaction()
2252 if (reply) freeReplyObject(reply); in clusterManagerExecTransaction()
2273 redisReply *reply = redisCommand(node->context,"AUTH %s",config.auth); in clusterManagerNodeConnect() local
2274 int ok = clusterManagerCheckRedisReply(node, reply, NULL); in clusterManagerNodeConnect()
2275 if (reply != NULL) freeReplyObject(reply); in clusterManagerNodeConnect()
2718 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, "DBSIZE"); in clusterManagerShowClusterInfo() local
2719 if (reply != NULL || reply->type == REDIS_REPLY_INTEGER) in clusterManagerShowClusterInfo()
2720 dbsize = reply->integer; in clusterManagerShowClusterInfo()
2723 if (reply != NULL && reply->type == REDIS_REPLY_ERROR) in clusterManagerShowClusterInfo()
2724 err = reply->str; in clusterManagerShowClusterInfo()
2726 if (reply != NULL) freeReplyObject(reply); in clusterManagerShowClusterInfo()
2729 if (reply != NULL) freeReplyObject(reply); in clusterManagerShowClusterInfo()
2745 redisReply *reply = NULL; in clusterManagerAddSlots() local
2775 reply = (redisReply*) _reply; in clusterManagerAddSlots()
2776 success = clusterManagerCheckRedisReply(node, reply, err); in clusterManagerAddSlots()
2783 if (reply != NULL) freeReplyObject(reply); in clusterManagerAddSlots()
2791 redisReply *reply = CLUSTER_MANAGER_COMMAND(node1, "CLUSTER " in clusterManagerSetSlot() local
2796 if (!reply) return 0; in clusterManagerSetSlot()
2798 if (reply->type == REDIS_REPLY_ERROR) { in clusterManagerSetSlot()
2801 *err = zmalloc((reply->len + 1) * sizeof(char)); in clusterManagerSetSlot()
2802 strcpy(*err, reply->str); in clusterManagerSetSlot()
2803 } else CLUSTER_MANAGER_PRINT_REPLY_ERROR(node1, reply->str); in clusterManagerSetSlot()
2807 freeReplyObject(reply); in clusterManagerSetSlot()
2812 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, in clusterManagerClearSlotStatus() local
2814 int success = clusterManagerCheckRedisReply(node, reply, NULL); in clusterManagerClearSlotStatus()
2815 if (reply) freeReplyObject(reply); in clusterManagerClearSlotStatus()
2822 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, in clusterManagerDelSlot() local
2825 int success = clusterManagerCheckRedisReply(node, reply, &err); in clusterManagerDelSlot()
2826 if (!success && reply && reply->type == REDIS_REPLY_ERROR && in clusterManagerDelSlot()
2828 strstr(reply->str, "already unassigned") != NULL) success = 1; in clusterManagerDelSlot()
2833 if (reply) freeReplyObject(reply); in clusterManagerDelSlot()
2838 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, in clusterManagerAddSlot() local
2840 int success = clusterManagerCheckRedisReply(node, reply, NULL); in clusterManagerAddSlot()
2841 if (reply) freeReplyObject(reply); in clusterManagerAddSlot()
2848 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, in clusterManagerCountKeysInSlot() local
2851 int success = clusterManagerCheckRedisReply(node, reply, NULL); in clusterManagerCountKeysInSlot()
2852 if (success && reply->type == REDIS_REPLY_INTEGER) count = reply->integer; in clusterManagerCountKeysInSlot()
2853 if (reply) freeReplyObject(reply); in clusterManagerCountKeysInSlot()
2858 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, "CLUSTER BUMPEPOCH"); in clusterManagerBumpEpoch() local
2859 int success = clusterManagerCheckRedisReply(node, reply, NULL); in clusterManagerBumpEpoch()
2860 if (reply) freeReplyObject(reply); in clusterManagerBumpEpoch()
2864 static int clusterManagerIgnoreUnassignedErr(redisReply *reply, int bulk_idx) { in clusterManagerIgnoreUnassignedErr() argument
2865 if (bulk_idx == 0 && reply) { in clusterManagerIgnoreUnassignedErr()
2866 if (reply->type == REDIS_REPLY_ERROR) in clusterManagerIgnoreUnassignedErr()
2867 return strstr(reply->str, "already unassigned") != NULL; in clusterManagerIgnoreUnassignedErr()
2894 redisReply *reply, in clusterManagerMigrateKeysInReply() argument
2903 size_t argc = c + reply->elements; in clusterManagerMigrateKeysInReply()
2939 for (i = 0; i < reply->elements; i++) { in clusterManagerMigrateKeysInReply()
2940 redisReply *entry = reply->element[i]; in clusterManagerMigrateKeysInReply()
2947 if (dots) dots[reply->elements] = '\0'; in clusterManagerMigrateKeysInReply()
2952 for (i = 0; i < reply->elements; i++) sdsfree(argv[i + offset]); in clusterManagerMigrateKeysInReply()
2973 redisReply *reply = NULL, *migrate_reply = NULL; in clusterManagerMigrateKeysInSlot() local
2974 reply = CLUSTER_MANAGER_COMMAND(source, "CLUSTER " in clusterManagerMigrateKeysInSlot()
2977 success = (reply != NULL); in clusterManagerMigrateKeysInSlot()
2979 if (reply->type == REDIS_REPLY_ERROR) { in clusterManagerMigrateKeysInSlot()
2982 *err = zmalloc((reply->len + 1) * sizeof(char)); in clusterManagerMigrateKeysInSlot()
2983 strcpy(*err, reply->str); in clusterManagerMigrateKeysInSlot()
2988 assert(reply->type == REDIS_REPLY_ARRAY); in clusterManagerMigrateKeysInSlot()
2989 size_t count = reply->elements; in clusterManagerMigrateKeysInSlot()
2991 freeReplyObject(reply); in clusterManagerMigrateKeysInSlot()
2997 reply, 0, timeout, in clusterManagerMigrateKeysInSlot()
3015 reply, in clusterManagerMigrateKeysInSlot()
3040 if (reply != NULL) freeReplyObject(reply); in clusterManagerMigrateKeysInSlot()
3122 redisReply *reply = NULL; in clusterManagerFlushNodeConfig() local
3126 reply = CLUSTER_MANAGER_COMMAND(node, "CLUSTER REPLICATE %s", in clusterManagerFlushNodeConfig()
3128 if (reply == NULL || (is_err = (reply->type == REDIS_REPLY_ERROR))) { in clusterManagerFlushNodeConfig()
3130 *err = zmalloc((reply->len + 1) * sizeof(char)); in clusterManagerFlushNodeConfig()
3131 strcpy(*err, reply->str); in clusterManagerFlushNodeConfig()
3146 if (reply != NULL) freeReplyObject(reply); in clusterManagerFlushNodeConfig()
3169 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, "CLUSTER NODES"); in clusterManagerNodeLoadInfo() local
3172 if (!clusterManagerCheckRedisReply(node, reply, err)) { in clusterManagerNodeLoadInfo()
3177 char *lines = reply->str, *p, *line; in clusterManagerNodeLoadInfo()
3338 if (reply) freeReplyObject(reply); in clusterManagerNodeLoadInfo()
3444 redisReply *reply = CLUSTER_MANAGER_COMMAND(node, "CLUSTER NODES"); in clusterManagerGetConfigSignature() local
3445 if (reply == NULL || reply->type == REDIS_REPLY_ERROR) in clusterManagerGetConfigSignature()
3447 char *lines = reply->str, *p, *line; in clusterManagerGetConfigSignature()
3525 if (reply != NULL) freeReplyObject(reply); in clusterManagerGetConfigSignature()
3711 redisReply *reply = CLUSTER_MANAGER_COMMAND(n, in clusterManagerFixSlotsCoverage() local
3713 if (!clusterManagerCheckRedisReply(n, reply, NULL)) { in clusterManagerFixSlotsCoverage()
3715 if (reply) freeReplyObject(reply); in clusterManagerFixSlotsCoverage()
3718 assert(reply->type == REDIS_REPLY_ARRAY); in clusterManagerFixSlotsCoverage()
3719 if (reply->elements > 0) { in clusterManagerFixSlotsCoverage()
3726 freeReplyObject(reply); in clusterManagerFixSlotsCoverage()
4774 redisReply *reply = NULL; in clusterManagerCommandCreate() local
4775 reply = CLUSTER_MANAGER_COMMAND(node, in clusterManagerCommandCreate()
4778 if (reply != NULL) freeReplyObject(reply); in clusterManagerCommandCreate()
4790 redisReply *reply = NULL; in clusterManagerCommandCreate() local
4791 reply = CLUSTER_MANAGER_COMMAND(node, "cluster meet %s %d", in clusterManagerCommandCreate()
4794 if (reply != NULL) { in clusterManagerCommandCreate()
4795 if ((is_err = reply->type == REDIS_REPLY_ERROR)) in clusterManagerCommandCreate()
4796 CLUSTER_MANAGER_PRINT_REPLY_ERROR(node, reply->str); in clusterManagerCommandCreate()
4797 freeReplyObject(reply); in clusterManagerCommandCreate()
4857 redisReply *reply = NULL; in clusterManagerCommandAddNode() local
4925 reply = CLUSTER_MANAGER_COMMAND(new_node, "CLUSTER MEET %s %d", in clusterManagerCommandAddNode()
4927 if (!(success = clusterManagerCheckRedisReply(new_node, reply, NULL))) in clusterManagerCommandAddNode()
4936 freeReplyObject(reply); in clusterManagerCommandAddNode()
4937 reply = CLUSTER_MANAGER_COMMAND(new_node, "CLUSTER REPLICATE %s", in clusterManagerCommandAddNode()
4939 if (!(success = clusterManagerCheckRedisReply(new_node, reply, NULL))) in clusterManagerCommandAddNode()
4945 if (reply) freeReplyObject(reply); in clusterManagerCommandAddNode()
5449 redisReply *reply = CLUSTER_MANAGER_COMMAND(n, "CONFIG %s %s %d", in clusterManagerCommandSetTimeout() local
5453 if (reply == NULL) goto reply_err; in clusterManagerCommandSetTimeout()
5454 int ok = clusterManagerCheckRedisReply(n, reply, &err); in clusterManagerCommandSetTimeout()
5455 freeReplyObject(reply); in clusterManagerCommandSetTimeout()
5457 reply = CLUSTER_MANAGER_COMMAND(n, "CONFIG %s", "REWRITE"); in clusterManagerCommandSetTimeout()
5458 if (reply == NULL) goto reply_err; in clusterManagerCommandSetTimeout()
5459 ok = clusterManagerCheckRedisReply(n, reply, &err); in clusterManagerCommandSetTimeout()
5460 freeReplyObject(reply); in clusterManagerCommandSetTimeout()
5643 redisReply *reply = NULL; in clusterManagerCommandCall() local
5645 int status = redisGetReply(n->context, (void **)(&reply)); in clusterManagerCommandCall()
5646 if (status != REDIS_OK || reply == NULL ) in clusterManagerCommandCall()
5649 sds formatted_reply = cliFormatReplyRaw(reply); in clusterManagerCommandCall()
5653 if (reply != NULL) freeReplyObject(reply); in clusterManagerCommandCall()
5721 redisReply *reply; in latencyMode() local
5740 reply = reconnectingRedisCommand(context,"PING"); in latencyMode()
5741 if (reply == NULL) { in latencyMode()
5746 freeReplyObject(reply); in latencyMode()
5845 redisReply *reply; in latencyDistMode() local
5893 reply = reconnectingRedisCommand(context,"PING"); in latencyDistMode()
5894 if (reply == NULL) { in latencyDistMode()
5899 freeReplyObject(reply); in latencyDistMode()
6050 redisReply *reply; in pipeMode() local
6093 if (redisReaderGetReply(reader,(void**)&reply) == REDIS_ERR) { in pipeMode()
6097 if (reply) { in pipeMode()
6098 if (reply->type == REDIS_REPLY_ERROR) { in pipeMode()
6099 fprintf(stderr,"%s\n", reply->str); in pipeMode()
6101 } else if (eof && reply->type == REDIS_REPLY_STRING && in pipeMode()
6102 reply->len == 20) { in pipeMode()
6106 if (memcmp(reply->str,magic,20) == 0) { in pipeMode()
6113 freeReplyObject(reply); in pipeMode()
6115 } while(reply); in pipeMode()
6204 redisReply *reply = redisCommand(context, "SCAN %llu", *it); in sendScan() local
6207 if(reply == NULL) { in sendScan()
6210 } else if(reply->type == REDIS_REPLY_ERROR) { in sendScan()
6211 fprintf(stderr, "SCAN error: %s\n", reply->str); in sendScan()
6213 } else if(reply->type != REDIS_REPLY_ARRAY) { in sendScan()
6216 } else if(reply->elements != 2) { in sendScan()
6222 assert(reply->element[0]->type == REDIS_REPLY_STRING); in sendScan()
6223 assert(reply->element[1]->type == REDIS_REPLY_ARRAY); in sendScan()
6226 *it = strtoull(reply->element[0]->str, NULL, 10); in sendScan()
6228 return reply; in sendScan()
6232 redisReply *reply; in getDbSize() local
6235 reply = redisCommand(context, "DBSIZE"); in getDbSize()
6237 if(reply == NULL || reply->type != REDIS_REPLY_INTEGER) { in getDbSize()
6243 size = reply->integer; in getDbSize()
6244 freeReplyObject(reply); in getDbSize()
6294 redisReply *reply; in getKeyTypes() local
6304 if(redisGetReply(context, (void**)&reply)!=REDIS_OK) { in getKeyTypes()
6308 } else if(reply->type != REDIS_REPLY_STATUS) { in getKeyTypes()
6309 if(reply->type == REDIS_REPLY_ERROR) { in getKeyTypes()
6310 fprintf(stderr, "TYPE returned an error: %s\n", reply->str); in getKeyTypes()
6314 reply->type, keys->element[i]->str); in getKeyTypes()
6319 sds typereply = sdsnew(reply->str); in getKeyTypes()
6325 …else if (strcmp(reply->str, "none")) /* create new types for modules, (but not for deleted keys) */ in getKeyTypes()
6326 type = typeinfo_add(types_dict, reply->str, &type_other); in getKeyTypes()
6328 freeReplyObject(reply); in getKeyTypes()
6336 redisReply *reply; in getKeySizes() local
6365 if(redisGetReply(context, (void**)&reply)!=REDIS_OK) { in getKeySizes()
6369 } else if(reply->type != REDIS_REPLY_INTEGER) { in getKeySizes()
6378 sizes[i] = reply->integer; in getKeySizes()
6381 freeReplyObject(reply); in getKeySizes()
6387 redisReply *reply, *keys; in findBigKeys() local
6416 reply = sendScan(&it); in findBigKeys()
6417 keys = reply->element[1]; in findBigKeys()
6478 freeReplyObject(reply); in findBigKeys()
6521 redisReply *reply; in getKeyFreqs() local
6531 if(redisGetReply(context, (void**)&reply)!=REDIS_OK) { in getKeyFreqs()
6535 } else if(reply->type != REDIS_REPLY_INTEGER) { in getKeyFreqs()
6536 if(reply->type == REDIS_REPLY_ERROR) { in getKeyFreqs()
6537 fprintf(stderr, "Error: %s\n", reply->str); in getKeyFreqs()
6544 freqs[i] = reply->integer; in getKeyFreqs()
6546 freeReplyObject(reply); in getKeyFreqs()
6552 redisReply *keys, *reply; in findHotKeys() local
6573 reply = sendScan(&it); in findHotKeys()
6574 keys = reply->element[1]; in findHotKeys()
6622 freeReplyObject(reply); in findHotKeys()
6705 redisReply *reply; in statMode() local
6713 reply = reconnectingRedisCommand(context,"INFO"); in statMode()
6714 if (reply->type == REDIS_REPLY_ERROR) { in statMode()
6715 printf("ERROR: %s\n", reply->str); in statMode()
6731 k = getLongInfoField(reply->str,buf); in statMode()
6739 aux = getLongInfoField(reply->str,"used_memory"); in statMode()
6744 aux = getLongInfoField(reply->str,"connected_clients"); in statMode()
6749 aux = getLongInfoField(reply->str,"blocked_clients"); in statMode()
6754 aux = getLongInfoField(reply->str,"total_commands_processed"); in statMode()
6760 aux = getLongInfoField(reply->str,"total_connections_received"); in statMode()
6765 aux = getLongInfoField(reply->str,"bgsave_in_progress"); in statMode()
6766 aux |= getLongInfoField(reply->str,"aof_rewrite_in_progress") << 1; in statMode()
6767 aux |= getLongInfoField(reply->str,"loading") << 2; in statMode()
6785 freeReplyObject(reply); in statMode()
6795 redisReply *reply; in scanMode() local
6800 reply = redisCommand(context,"SCAN %llu MATCH %s", in scanMode()
6803 reply = redisCommand(context,"SCAN %llu",cur); in scanMode()
6804 if (reply == NULL) { in scanMode()
6807 } else if (reply->type == REDIS_REPLY_ERROR) { in scanMode()
6808 printf("ERROR: %s\n", reply->str); in scanMode()
6813 cur = strtoull(reply->element[0]->str,NULL,10); in scanMode()
6814 for (j = 0; j < reply->element[1]->elements; j++) in scanMode()
6815 printf("%s\n", reply->element[1]->element[j]->str); in scanMode()
6817 freeReplyObject(reply); in scanMode()
6854 redisReply *reply; in LRUTestMode() local
6876 redisGetReply(context, (void**)&reply); in LRUTestMode()
6884 if (redisGetReply(context, (void**)&reply) == REDIS_OK) { in LRUTestMode()
6885 switch(reply->type) { in LRUTestMode()
6887 printf("%s\n", reply->str); in LRUTestMode()