adilbaig/Tiny-Redis

`SCAN` very strange issue

Closed this issue · 1 comments

o3o commented

I've this test (database is empty)

unittest {
   auto redis = new Redis();
   int cursor;
   auto response =    redis.send("FLUSHDB");
   do {
      response = redis.send("SCAN", cursor);
      cursor = response.values[0].toInt;
   } while (cursor > 0);
}

then

dub test --debug=tinyredis
No source files found in configuration 'library'. Falling back to "dub -b unittest".
Performing "unittest" build using /usr/bin/dmd for x86_64.
tinyredis 2.1.1: target for configuration "default" is up to date.
tinyredis-test ~master: building configuration "application"...
Linking...
To force a rebuild of up-to-date targets, run again with --force.
Running ./tinyredis-test 
*1\r\n$7\r\nFLUSHDB\r\n
Response : '+OK\r\n' Length : 5
BUFFER : +OK\r\n
*2\r\n$4\r\nSCAN\r\n$1\r\n0\r\n
Response : '*2\r\n$1\r\n0\r\n*0\r\n' Length : 15
BUFFER : *2\r\n$1\r\n0\r\n*0\r\n

..my application freezes.

If I put same code in Tiny-Redis/source/tinyredis/redis.d :

$ make test 
...
...
*1\r\n$7\r\nFLUSHDB\r\n
Response : '+OK\r\n' Length : 5
*2\r\n$4\r\nSCAN\r\n$1\r\n0\r\n
Response : '*2\r\n$1\r\n0\r\n*0\r\n' Length : 15
All unit tests have been run successfully.

it works...

Any suggestion? Thank you

o3o commented

Duplicated .. see #32