returns false in case of effect encode/decode version mismatch
| 484 | |
| 485 | // returns false in case of effect encode/decode version mismatch |
| 486 | static bool ValidateVersion |
| 487 | ( |
| 488 | FILE *stream // effects stream |
| 489 | ) { |
| 490 | ASSERT(stream != NULL); |
| 491 | |
| 492 | // read version |
| 493 | uint8_t v; |
| 494 | fread_assert(&v, sizeof(uint8_t), stream); |
| 495 | |
| 496 | if(v != EFFECTS_VERSION) { |
| 497 | // unexpected effects version |
| 498 | RedisModule_Log(NULL, "warning", |
| 499 | "GRAPH.EFFECT version mismatch expected: %d got: %d", |
| 500 | EFFECTS_VERSION, v); |
| 501 | return false; |
| 502 | } |
| 503 | |
| 504 | return true; |
| 505 | } |
| 506 | |
| 507 | // applys effects encoded in buffer |
| 508 | void Effects_Apply |