redis-check-dump now understands dumps produced by Redis 2.6
redis-check-dump now understands dumps produced by Redis 2.6

(Commit message from @antirez as it was missign in the original commits,
also the patch was modified a bit to still work with 2.4 dumps and to
avoid if expressions that are always true due to checked types range)

This commit changes redis-check-dump to account for new encodings and
for the new MSTIME expire format. It also refactors the test for valid
type into a function.

The code is still compatible with Redis 2.4 generated dumps.

This fixes issue #709.

seandsky/redis,badboy/redis,fengshao0907/redis,Soledad89/redis,jacklee0810/annotated_redis_source,4396/redis,pietern/redis,wprice/redis,aim-for-better/redis,ipmobiletech/redis,mcanthony/redis,gilala/bjredis,himoca/redis,gilala/hredis,OmarQunsul/graph-redis,janekmi/redis,NBSW/redis,valdsJohn/redis,kensou97/redis,vincent-vivian-liu/redis,SyntaxStacks/redis,j0hnma/hszredis,july2993/redis,wuyu201321060203/redis-3.0-annotated,hornen/redis,huangz1990/annotated_redis_source,viongpanzi/annotated_redis_source,mengzhejin/RedisStudy,oranagra/redis,PradheepShrinivasan/redis,CodeJuan/redis,LongXQ/redis,SyntaxStacks/redis,190235047/redis,ReadCode/redis-3.0-annotated,PKRoma/redis,NBSW/redis,zy416548283/redis-3.0-annotated,wprice/redis,GrimDerp/redis,tidatida/annotated_redis_source,moonbingbing/redis-3.0-annotated,clamoriniere1A/redis,Cisphyx/redis-websockets,4396/redis,PKRoma/redis,iandyh/redis,colstrom/redis,flashbuckets/redis,Aliceljm1/redis-3.0-annotated,190235047/redis,hhli/redis,j0hnma/szredis,Markgorden/redis,sunheehnus/redis,netroby/redis,jermnelson/redis,GrimDerp/redis,saisai/redis,zczhuohuo/redis,Aliceljm1/redis,colstrom/redis,tanghaodong25/redis,Markgorden/redis,mumingv/redis,arijitvt/redis,PradheepShrinivasan/redis,antirez/redis,wangyikai/redis,vincent-vivian-liu/redis,timothyohare/3rdPartySrc-redis,cloudrain21/redis,pcarrier/redis,modulexcite/redis,itugs/redis,citusdata/redis,z-fork/redis,charsyam/redis,ituncle/redis,wprice/redis,zhcy/redis,darksideofthemoo/redis-histogram,PradheepShrinivasan/redis,supasate/redis,pedigree/redis,ErikDubbelboer/redis,ton31337/redis,supasate/redis,netroby/redis,MOON-CLJ/redis,rogerlz/redis,iandyh/redis,hawkchch/redis,pmem/redis,JoeWoo/redis,huyuezheng/redis,HouKangkang/redis-3.0-annotated,ChaosCoo/annotated_redis_source,jasonkying/redis,onlymellb/redis-3.0-annotated,itugs/redis,gaoxianglong/redis,a-pavlov/redis,wuyu201321060203/redis-3.0-annotated,alenslan/redis,hornen/redis,wuyu201321060203/redis-3.0-annotated,tidatida/annotated_redis_source,jacklee0810/annotated_redis_source,atreeyang/redis,jacklee0810/redis-3.0-annotated,universsky/redis,ChanningDuan/annotated_redis_source,tzq668766/redis-3.0-annotated,fankeke/redis-3.0-annotated,4396/redis,mgk/redis,programmecat/redis,danny200309/annotated_redis_source,hedisdb/hedis,zhaobo1023/redis-3.0-annotated,tzq668766/redis-3.0-annotated,slfs007/mk-redis,Wangyao14cyy/redis,HeartSaVioR/redis,danny200309/annotated_redis_source,cloudrain21/redis,ketor/redis,Aaron1992/redis,allengaller/redis,rogerlz/redis,0x55/redis-3.0-annotated,darksideofthemoo/redis-histogram,huangz1990/redis-3.0-annotated,weizijun/redis,soveran/redis,zhiliaoniu/redis,dayuoba/redis,mcanthony/redis,twskipper/redis,wprice/redis,adamweixuan/redis-3.0-annotated,Soledad89/redis,wuxiaowei907/annotated_redis_source,pcarrier/redis,YuraLukashik/redis,elkingtonmcb/redis,himoca/redis,CodeJuan/redis,zguangyu/redis,dayuoba/redis,seppo0010/rlite-server,sunheehnus/redis,taoguan/redis,seppo0010/rlite-server,josiahcarlson/redis,gechong/redis-3.0-annotated,timothyohare/3rdPartySrc-redis,onlymellb/redis-3.0-annotated,davidradunz/redis,mingyaaaa/redis,gilala/hbjredis,gilala/redis,seandsky/redis,mverrilli/redis,rogerlz/redis,qiyang0221/redis,ituncle/redis,ofirluzon/redis,mengyou0304/redis,SummonY/redis,hedisdb/hedis,vincent-vivian-liu/redis,dreamquster/redis,Hailei/redis,ksarch-saas/redis,davidradunz/redis,tidatida/annotated_redis_source,StevenTsai/redis,ofirluzon/redis,maodeyi/redis_lua,duanx/redis,zguangyu/redis,brg-liuwei/redis,hgl888/redis,iandyh/redis,idning/redis,0x20h/redis,blackmady/redis,mumingv/redis,roth1002/redis,mumingv/redis,gilala/bjredis,unasm/redis-3.0-annotated,kensou97/redis,simplestbest/redis,ouyangkongtong/redis,rogerlz/redis,holstvoogd/redis,MasahikoSawada/redis,zhoudayang/redis,linfangrong/redis,elkingtonmcb/redis,dreamquster/redis,badboy/redis,yybirdcf/learn-redis,machicao2013/redis-source-annotated,soveran/redis,huangz1990/experiment-redis,wbailey5/redis,mpalmer/redis,slfs007/mk-redis,SyntaxStacks/redis,allengaller/redis,miaoyc1989/redis-3.0-annotated,ouyangkongtong/redis,OmarQunsul/graph-redis,wenxueliu/redis_comment,ytjiang/redis,shining-yang/redis,MasahikoSawada/redis,jxwr/redis,xujunhai1991/redis,rrsean/redis-3.0-annotated,atreeyang/redis,jackyan/redis,Hailei/redis,ncopa/redis,riyan8250/redis,ipmobiletech/redis,elkingtonmcb/redis,ituncle/redis,kaushik94/redis,riyan8250/redis,tellapart/redis,spinlock/redis,gilala/hbjredis,viongpanzi/annotated_redis_source,spearhead-ea/redis,simplestbest/redis,jermnelson/redis,GrimDerp/redis,saisai/redis,ipmobiletech/redis,drinkthere/redis-3.0-annotated,YuraLukashik/redis,francischan714/redis,fengshao0907/redis-3.0-annotated,machicao2013/redis-source-annotated,xuzhezhaozhao/redis_reading,HunanTV/redis,ctripcorp/redis,Aliceljm1/redis,fengshao0907/redis-3.0-annotated,wangyikai/redis,darksideofthemoo/redis-histogram,aim-for-better/redis,jackyan/redis,xujunhai1991/redis,dongqifan2/redis-3.0-annotated,YongMan/redis,davidradunz/redis,honestme/redis,roth1002/redis,ksarch-saas/redis,rouzier/redis,4396/redis,xuguruogu/redis,hhli/redis,ytjiang/redis,janekmi/redis,programmecat/redis,huangz1990/experiment-redis,hgl888/redis,190235047/redis,ytjiang/redis,Cisphyx/redis-websockets,holstvoogd/redis,Aliceljm1/redis,gilala/bjredis,july2993/redis,rogerchina/redis,magastzheng/redis-3.0-annotated,j0hnma/hszredis,mverrilli/redis,duanx/redis,gilala/redis,arijitvt/redis,zhcy/redis,riyan8250/redis,WorkingOfTimtohyZhang/redis-3.0-annotated,nnog/redis,francischan714/redis,mumingv/redis-3.0-annotated,Soledad89/redis,drinkthere/redis-3.0-annotated,pmem/redis,ramonsnir/redis,splitice/redis,msn217/redis-3.0-annotated,nilyang/redis-tdd-annotation,adamweixuan/redis-3.0-annotated,csuhawk/redis,iandyh/redis,AALEKH/redis,spearhead-ea/redis,colstrom/redis,july2993/redis,timothyohare/3rdPartySrc-redis,figoxu/annotated_redis_source,devaos/redis,Cisphyx/redis-websockets,RepmujNetsik/redis,harrisonfeng/redis,csuhawk/redis,gilala/redis,jasonkying/redis,ketor/redis,ttuna/msot-redis,ouyangkongtong/redis,ChanningDuan/annotated_redis_source,ReadCode/redis-3.0-annotated,rogerchina/redis,clamoriniere1A/redis,shshlzh/redis-3.0-annotated,linfangrong/redis,flashbuckets/redis,tjschuck/redis,valdsJohn/redis,yossigo/redis,mingyaaaa/redis,ttuna/msot-redis,duanx/redis,CodeJuan/redis,izhoujie/redis,charsyam/redis,ErikDubbelboer/redis,GitHubMota/redis,whille/redis-3.0-annotated,GitHubMota/redis,mingyaaaa/redis,hgl888/redis,wujf/redis,HeartSaVioR/redis,moonbingbing/redis-3.0-annotated,atreeyang/redis,PKRoma/redis,blackmady/redis,Aaron1992/redis,onlymellb/redis-3.0-annotated,tjschuck/redis,maodeyi/redis_lua,whille/redis-3.0-annotated,saisai/redis,tellapart/redis,wenxueliu/redis_comment,magastzheng/redis-3.0-annotated,wangyikai/redis,cloudrain21/redis,pietern/redis,ton31337/redis,ttuna/msot-redis,figoxu/annotated_redis_source,xujunhai1991/redis,ouyangkongtong/redis,ofirluzon/redis,AplayER/redis,aim-for-better/redis,blackmady/redis,gilala/hbjredis,seppo0010/redis,itamarhaber/redis,xuguruogu/redis,jacklee0810/redis-3.0-annotated,gongice/redis-3.0-annotated,dreamquster/redis,timothyohare/3rdPartySrc-redis,pmem/redis,xuzhezhaozhao/redis_reading,gilala/hredis,mumingv/redis,simplestbest/redis,takeshineshiro/redis,ketor/redis,jbochi/parallel_redis,supasate/redis,figoxu/annotated_redis_source,xuzhezhaozhao/redis_reading,pkdevbox/redis,allengaller/redis,xuzhezhaozhao/redis_reading,wbailey5/redis,josiahcarlson/redis,fengshao0907/annotated_redis_source,dongqifan2/redis-3.0-annotated,MSOpenTech/redis,flashbuckets/redis,YuanZhewei/redis,jingjidejuren/redis,honestme/redis,ErikDubbelboer/redis,AplayER/redis,elkingtonmcb/redis,dongqifan2/redis-3.0-annotated,itugs/redis,holstvoogd/redis,idning/redis,citusdata/redis,zczhuohuo/redis,mengzhejin/RedisStudy,thomasdarimont/redis,seppo0010/redis,oranagra/redis,PKRoma/redis,fengshao0907/redis-3.0-annotated,pcarrier/redis,spinlock/redis,zhcy/redis,huangz1990/experiment-redis,mumingv/redis-3.0-annotated,weizijun/redis,tzq668766/redis-3.0-annotated,shreesundara/redis,Aliceljm1/redis-3.0-annotated,wujf/redis,0x20h/redis,SummonY/redis,roth1002/redis,ncopa/redis,mpalmer/redis,wbailey5/redis,splitice/redis,j0hnma/hszredis,wbailey5/redis,valdsJohn/redis,cusspvz/redis,Wangyao14cyy/redis,rouzier/redis,alenslan/redis,jacklee0810/annotated_redis_source,hhli/redis,sunheehnus/redis,qiyang0221/redis,GrimDerp/redis,ChanningDuan/annotated_redis_source,WorkingOfTimtohyZhang/redis-3.0-annotated,mengyou0304/redis,jasonkying/redis,nilyang/redis-tdd-annotation,simplestbest/redis,abhiklodh/redis,xlzhan/redis,programmecat/redis,devaos/redis,zhcy/redis,jacklee0810/redis-3.0-annotated,programmecat/redis,yuhc/redis-benchmark-enhanced,guker/redis,Sciumo/redis,sunlianqiang/redis-3.0-annotated,buobao/redis-3.0-annotated,linfangrong/redis,brg-liuwei/redis,jackyan/redis,YuanZhewei/redis,charsyam/redis,dramenk/annotated_redis_source,holstvoogd/redis,nilyang/redis-tdd-annotation,oranagra/redis,huyuezheng/redis,LongXQ/redis,davidradunz/redis,SyntaxStacks/redis,gongice/redis-3.0-annotated,takeshineshiro/redis,mpalmer/redis,citusdata/redis,YongMan/redis,neomantra/redis,louisliangjun/redis,MasahikoSawada/redis,hgl888/redis,zhoudayang/redis,danny200309/annotated_redis_source,fengshao0907/redis,gspandy/annotated_redis_source,tjschuck/redis,pkdevbox/redis,HunanTV/redis,narma/redis,jxwr/redis,miaoyc1989/redis-3.0-annotated,ipmobiletech/redis,YuanZhewei/redis,ofirluzon/redis,weizijun/redis,shreesundara/redis,jbochi/redis,taoguan/redis,dreamquster/redis,zguangyu/redis,soloestoy/redis,huangz1990/annotated_redis_source,weizijun/redis,MOON-CLJ/redis,gongice/redis-3.0-annotated,shreesundara/redis,GitHubMota/redis,netroby/redis,j0hnma/hszredis,roth1002/redis,nnog/redis,tanghaodong25/redis,gilala/hredis,mumingv/redis-3.0-annotated,MOON-CLJ/redis,cnbin/redis,modulexcite/redis,zhiliaoniu/redis,cusspvz/redis,citusdata/redis,HeartSaVioR/redis,seandsky/redis,pcarrier/redis,hawkchch/redis,july2993/redis,sunlianqiang/redis-3.0-annotated,spinlock/redis,qiyang0221/redis,universsky/redis,healerkx/redis,tellapart/redis,dayuoba/redis,duanx/redis,Wangyao14cyy/redis,jackyan/redis,SummonY/redis,unasm/redis-3.0-annotated,ctripcorp/redis,jxwr/redis,jbochi/parallel_redis,h0x91b/redis,idning/redis,fengshao0907/redis,kmiku7/redis,yybirdcf/learn-redis,wenxueliu/redis_comment,MSOpenTech/redis,LongXQ/redis,StevenTsai/redis,YongMan/redis,mingyaaaa/redis,wujf/redis,huangz1990/annotated_redis_source,rogerchina/redis,universsky/redis,devaos/redis,ytjiang/redis,kaushik94/redis,twskipper/redis,OmarQunsul/graph-redis,kensou97/redis,itamarhaber/redis,vincent-vivian-liu/redis,MSOpenTech/redis,mengzhejin/RedisStudy,YongMan/redis,a-pavlov/redis,wuxiaowei907/annotated_redis_source,Aaron1992/redis,harrisonfeng/redis,zguangyu/redis,YuanZhewei/redis,mverrilli/redis,wujf/redis,ramonsnir/redis,a-pavlov/redis,arijitvt/redis,hhli/redis,rouzier/redis,pietern/redis,guker/redis,jbochi/redis,yybirdcf/learn-redis,Hailei/redis,yybirdcf/learn-redis,fengshao0907/redis,jbochi/parallel_redis,pkdevbox/redis,brg-liuwei/redis,huyuezheng/redis,GitHubMota/redis,fengshao0907/annotated_redis_source,haima-zju/redis-3.0-annotated,hornen/redis,neomantra/redis,louisliangjun/redis,louisliangjun/redis,NBSW/redis,flashbuckets/redis,zczhuohuo/redis,msn217/redis-3.0-annotated,mattsta/redis,josiahcarlson/redis,AplayER/redis,Sciumo/redis,zy416548283/redis-3.0-annotated,shining-yang/redis,wangyikai/redis,riyan8250/redis,jingjidejuren/redis,soloestoy/redis,gechong/redis-3.0-annotated,jingjidejuren/redis,cloudrain21/redis,j0hnma/szredis,moonbingbing/redis-3.0-annotated,netroby/redis,mpalmer/redis,haima-zju/redis-3.0-annotated,AALEKH/redis,yossigo/redis,shshlzh/redis-3.0-annotated,mattsta/redis,hedisdb/hedis,neomantra/redis,rogerchina/redis,izhoujie/redis,JoeWoo/redis,HunanTV/redis,z-fork/redis,pmem/redis,seppo0010/redis,aim-for-better/redis,ChaosCoo/annotated_redis_source,hornen/redis,h0x91b/redis,AplayER/redis,louisliangjun/redis,thomasdarimont/redis,alenslan/redis,narma/redis,atreeyang/redis,devaos/redis,shreesundara/redis,antirez/redis,miaoyc1989/redis-3.0-annotated,healerkx/redis,ErikDubbelboer/redis,csuhawk/redis,magastzheng/redis-3.0-annotated,Sciumo/redis,neomantra/redis,dramenk/annotated_redis_source,mengzhejin/RedisStudy,mverrilli/redis,splitice/redis,yossigo/redis,pedigree/redis,nuxeh/redis,tjschuck/redis,shshlzh/redis-3.0-annotated,huangz1990/experiment-redis,modulexcite/redis,spearhead-ea/redis,buobao/redis-3.0-annotated,kmiku7/redis,AALEKH/redis,cnbin/redis,yuzhangjob/redis-3.0-annotated-unstable,kaushik94/redis,sunlianqiang/redis-3.0-annotated,Hailei/redis,gilala/redis,xuguruogu/redis,takeshineshiro/redis,yossigo/redis,janekmi/redis,wuyu201321060203/redis-3.0-annotated,zhoudayang/redis,healerkx/redis,wuxiaowei907/annotated_redis_source,msn217/redis-3.0-annotated,Cisphyx/redis-websockets,nuxeh/redis,NBSW/redis,ituncle/redis,healerkx/redis,xlzhan/redis,ttuna/msot-redis,h0x91b/redis,zhoudayang/redis,jbochi/redis,blackmady/redis,charsyam/redis,0x20h/redis,Markgorden/redis,seppo0010/rlite-server,twskipper/redis,ton31337/redis,allengaller/redis,gilala/hredis,mgk/redis,oranagra/redis,JoeWoo/redis,yuhc/redis-benchmark-enhanced,guker/redis,LongXQ/redis,pkdevbox/redis,xujunhai1991/redis,francischan714/redis,machicao2013/redis-source-annotated,soloestoy/redis,jasonkying/redis,yuhc/redis-benchmark-enhanced,zczhuohuo/redis,yossigo/redis,twskipper/redis,xlzhan/redis,seppo0010/redis,xuguruogu/redis,shining-yang/redis,SummonY/redis,wenxueliu/redis_comment,soloestoy/redis,z-fork/redis,0x55/redis-3.0-annotated,taoguan/redis,shshlzh/redis-3.0-annotated,WorkingOfTimtohyZhang/redis-3.0-annotated,idning/redis,gspandy/annotated_redis_source,RepmujNetsik/redis,whille/redis-3.0-annotated,cusspvz/redis,ncopa/redis,csuhawk/redis,guker/redis,spinlock/redis,thomasdarimont/redis,unasm/redis-3.0-annotated,StevenTsai/redis,brg-liuwei/redis,j0hnma/szredis,RepmujNetsik/redis,ramonsnir/redis,qiyang0221/redis,PKRoma/redis,0x55/redis-3.0-annotated,rrsean/redis-3.0-annotated,himoca/redis,badboy/redis,ChaosCoo/annotated_redis_source,harrisonfeng/redis,itugs/redis,nilyang/redis-tdd-annotation,zhiliaoniu/redis,mengyou0304/redis,valdsJohn/redis,gaoxianglong/redis,tanghaodong25/redis,ksarch-saas/redis,honestme/redis,kensou97/redis,darksideofthemoo/redis-histogram,YuraLukashik/redis,honestme/redis,OmarQunsul/graph-redis,mattsta/redis,a-pavlov/redis,ctripcorp/redis,soveran/redis,gaoxianglong/redis,antirez/redis,drinkthere/redis-3.0-annotated,francischan714/redis,cusspvz/redis,itamarhaber/redis,yuzhangjob/redis-3.0-annotated-unstable,charsyam/redis,fankeke/redis-3.0-annotated,StevenTsai/redis,mgk/redis,190235047/redis,gechong/redis-3.0-annotated,splitice/redis,machicao2013/redis-source-annotated,fengshao0907/annotated_redis_source,YuraLukashik/redis,h0x91b/redis,shining-yang/redis,soloestoy/redis,HouKangkang/redis-3.0-annotated,pietern/redis,ton31337/redis,izhoujie/redis,Aliceljm1/redis,0x20h/redis,josiahcarlson/redis,ofirluzon/redis,HunanTV/redis,cnbin/redis,zhiliaoniu/redis,dramenk/annotated_redis_source,CodeJuan/redis,hawkchch/redis,tanghaodong25/redis,saisai/redis,zy416548283/redis-3.0-annotated,nuxeh/redis,xlzhan/redis,jermnelson/redis,kmiku7/redis,adamweixuan/redis-3.0-annotated,zhaobo1023/redis-3.0-annotated,Aliceljm1/redis-3.0-annotated,clamoriniere1A/redis,linfangrong/redis,hawkchch/redis,seppo0010/rlite-server,gspandy/annotated_redis_source,taoguan/redis,Soledad89/redis,modulexcite/redis,pedigree/redis,mgk/redis,rrsean/redis-3.0-annotated,0x55/redis-3.0-annotated,colstrom/redis,kaushik94/redis,ctripcorp/redis,mcanthony/redis,rouzier/redis,takeshineshiro/redis,zhaobo1023/redis-3.0-annotated,nnog/redis,alenslan/redis,dayuoba/redis,z-fork/redis,ksarch-saas/redis,itamarhaber/redis,tellapart/redis,MasahikoSawada/redis,neomantra/redis,buobao/redis-3.0-annotated,JoeWoo/redis,jingjidejuren/redis,izhoujie/redis,PradheepShrinivasan/redis,huangz1990/redis-3.0-annotated,Sciumo/redis,abhiklodh/redis,narma/redis,Aaron1992/redis,nuxeh/redis,ttuna/msot-redis,j0hnma/szredis,maodeyi/redis_lua,supasate/redis,gaoxianglong/redis,slfs007/mk-redis,abhiklodh/redis,MSOpenTech/redis,mcanthony/redis,thomasdarimont/redis,sunheehnus/redis,universsky/redis,seandsky/redis,huangz1990/redis-3.0-annotated,yuzhangjob/redis-3.0-annotated-unstable,mengyou0304/redis,badboy/redis,miaoyc1989/redis-3.0-annotated,janekmi/redis,oranagra/redis,fankeke/redis-3.0-annotated,Markgorden/redis,viongpanzi/annotated_redis_source,huyuezheng/redis,clamoriniere1A/redis,pedigree/redis,Wangyao14cyy/redis,haima-zju/redis-3.0-annotated,MSOpenTech/redis,abhiklodh/redis,RepmujNetsik/redis,soveran/redis,harrisonfeng/redis,gilala/bjredis,cnbin/redis,kmiku7/redis,ReadCode/redis-3.0-annotated,HeartSaVioR/redis,hedisdb/hedis,arijitvt/redis,AALEKH/redis,ncopa/redis,gilala/hbjredis,antirez/redis,HouKangkang/redis-3.0-annotated,yuhc/redis-benchmark-enhanced,nnog/redis