| 1864 | } |
| 1865 | |
| 1866 | static int issueCommandRepeat(int argc, char **argv, long repeat) { |
| 1867 | while (1) { |
| 1868 | if (config.cluster_reissue_command || context == NULL || |
| 1869 | context->err == REDIS_ERR_IO || context->err == REDIS_ERR_EOF) |
| 1870 | { |
| 1871 | if (cliConnect(CC_FORCE) != REDIS_OK) { |
| 1872 | cliPrintContextError(); |
| 1873 | config.cluster_reissue_command = 0; |
| 1874 | return REDIS_ERR; |
| 1875 | } |
| 1876 | } |
| 1877 | config.cluster_reissue_command = 0; |
| 1878 | if (config.cluster_send_asking) { |
| 1879 | if (cliSendAsking() != REDIS_OK) { |
| 1880 | cliPrintContextError(); |
| 1881 | return REDIS_ERR; |
| 1882 | } |
| 1883 | } |
| 1884 | if (cliSendCommand(argc,argv,repeat) != REDIS_OK) { |
| 1885 | cliPrintContextError(); |
| 1886 | return REDIS_ERR; |
| 1887 | } |
| 1888 | |
| 1889 | /* Issue the command again if we got redirected in cluster mode */ |
| 1890 | if (config.cluster_mode && config.cluster_reissue_command) { |
| 1891 | continue; |
| 1892 | } |
| 1893 | break; |
| 1894 | } |
| 1895 | return REDIS_OK; |
| 1896 | } |
| 1897 | |
| 1898 | static int issueCommand(int argc, char **argv) { |
| 1899 | return issueCommandRepeat(argc, argv, config.repeat); |
no test coverage detected