Called on RDB errors. Provides details about the RDB and the offset * we were when the error was detected. */
| 103 | /* Called on RDB errors. Provides details about the RDB and the offset |
| 104 | * we were when the error was detected. */ |
| 105 | void rdbCheckError(const char *fmt, ...) { |
| 106 | char msg[1024]; |
| 107 | va_list ap; |
| 108 | |
| 109 | va_start(ap, fmt); |
| 110 | vsnprintf(msg, sizeof(msg), fmt, ap); |
| 111 | va_end(ap); |
| 112 | |
| 113 | printf("--- RDB ERROR DETECTED ---\n"); |
| 114 | printf("[offset %llu] %s\n", |
| 115 | (unsigned long long) (rdbstate.rio ? |
| 116 | rdbstate.rio->processed_bytes : 0), msg); |
| 117 | printf("[additional info] While doing: %s\n", |
| 118 | rdb_check_doing_string[rdbstate.doing]); |
| 119 | if (rdbstate.key) |
| 120 | printf("[additional info] Reading key '%s'\n", |
| 121 | (char*)ptrFromObj(rdbstate.key)); |
| 122 | if (rdbstate.key_type != -1) |
| 123 | printf("[additional info] Reading type %d (%s)\n", |
| 124 | rdbstate.key_type, |
| 125 | ((unsigned)rdbstate.key_type < |
| 126 | sizeof(rdb_type_string)/sizeof(char*)) ? |
| 127 | rdb_type_string[rdbstate.key_type] : "unknown"); |
| 128 | rdbShowGenericInfo(); |
| 129 | } |
| 130 | |
| 131 | /* Print informations during RDB checking. */ |
| 132 | void rdbCheckInfo(const char *fmt, ...) { |
no test coverage detected