@@ -198,12 +198,11 @@ protected virtual TypedRedisValue Hello(RedisClient client, in RedisRequest requ
198198 switch ( protover )
199199 {
200200 case 2 :
201- case 3 :
202201 protocol = RedisProtocol . Resp2 ;
203202 break ;
204- /* case 3: // this client does not currently support RESP3
203+ case 3 : // this client does not currently support RESP3
205204 protocol = RedisProtocol . Resp3 ;
206- break; */
205+ break ;
207206 default :
208207 return TypedRedisValue . Error ( "NOPROTO unsupported protocol version" ) ;
209208 }
@@ -234,7 +233,7 @@ protected virtual TypedRedisValue Hello(RedisClient client, in RedisRequest requ
234233 client . IsAuthenticated = isAuthed ;
235234 client . Name = name ;
236235
237- var reply = TypedRedisValue . Rent ( 14 , out var span ) ;
236+ var reply = TypedRedisValue . Rent ( 14 , out var span , ResultType . Map ) ;
238237 span [ 0 ] = TypedRedisValue . BulkString ( "server" ) ;
239238 span [ 1 ] = TypedRedisValue . BulkString ( "redis" ) ;
240239 span [ 2 ] = TypedRedisValue . BulkString ( "version" ) ;
@@ -248,7 +247,7 @@ protected virtual TypedRedisValue Hello(RedisClient client, in RedisRequest requ
248247 span [ 10 ] = TypedRedisValue . BulkString ( "role" ) ;
249248 span [ 11 ] = TypedRedisValue . BulkString ( "master" ) ;
250249 span [ 12 ] = TypedRedisValue . BulkString ( "modules" ) ;
251- span [ 13 ] = TypedRedisValue . EmptyArray ;
250+ span [ 13 ] = TypedRedisValue . EmptyArray ( ResultType . Array ) ;
252251 return reply ;
253252 }
254253
@@ -385,21 +384,21 @@ protected virtual TypedRedisValue ClusterSlots(RedisClient client, in RedisReque
385384 {
386385 count += pair . Value . Slots . Length ;
387386 }
388- var slots = TypedRedisValue . Rent ( count , out var slotsSpan ) ;
387+ var slots = TypedRedisValue . Rent ( count , out var slotsSpan , ResultType . Array ) ;
389388 foreach ( var pair in _nodes . OrderBy ( x => x . Key , EndPointComparer . Instance ) )
390389 {
391390 string host = GetHost ( pair . Key , out int port ) ;
392391 foreach ( var range in pair . Value . Slots )
393392 {
394393 if ( index >= count ) break ; // someone changed things while we were working
395- slotsSpan [ index ++ ] = TypedRedisValue . Rent ( 3 , out var slotSpan ) ;
394+ slotsSpan [ index ++ ] = TypedRedisValue . Rent ( 3 , out var slotSpan , ResultType . Array ) ;
396395 slotSpan [ 0 ] = TypedRedisValue . Integer ( range . From ) ;
397396 slotSpan [ 1 ] = TypedRedisValue . Integer ( range . To ) ;
398- slotSpan [ 2 ] = TypedRedisValue . Rent ( 4 , out var nodeSpan ) ;
397+ slotSpan [ 2 ] = TypedRedisValue . Rent ( 4 , out var nodeSpan , ResultType . Array ) ;
399398 nodeSpan [ 0 ] = TypedRedisValue . BulkString ( host ) ;
400399 nodeSpan [ 1 ] = TypedRedisValue . Integer ( port ) ;
401400 nodeSpan [ 2 ] = TypedRedisValue . BulkString ( pair . Value . Id ) ;
402- nodeSpan [ 3 ] = TypedRedisValue . EmptyArray ;
401+ nodeSpan [ 3 ] = TypedRedisValue . EmptyArray ( ResultType . Array ) ;
403402 }
404403 }
405404 return slots ;
@@ -717,20 +716,20 @@ protected virtual TypedRedisValue LRange(RedisClient client, in RedisRequest req
717716 long start = request . GetInt64 ( 2 ) , stop = request . GetInt64 ( 3 ) ;
718717
719718 var len = Llen ( client . Database , key ) ;
720- if ( len == 0 ) return TypedRedisValue . EmptyArray ;
719+ if ( len == 0 ) return TypedRedisValue . EmptyArray ( ResultType . Array ) ;
721720
722721 if ( start < 0 ) start = len + start ;
723722 if ( stop < 0 ) stop = len + stop ;
724723
725- if ( stop < 0 || start >= len || stop < start ) return TypedRedisValue . EmptyArray ;
724+ if ( stop < 0 || start >= len || stop < start ) return TypedRedisValue . EmptyArray ( ResultType . Array ) ;
726725
727726 if ( start < 0 ) start = 0 ;
728727 else if ( start >= len ) start = len - 1 ;
729728
730729 if ( stop < 0 ) stop = 0 ;
731730 else if ( stop >= len ) stop = len - 1 ;
732731
733- var arr = TypedRedisValue . Rent ( checked ( ( int ) ( ( stop - start ) + 1 ) ) , out var span ) ;
732+ var arr = TypedRedisValue . Rent ( checked ( ( int ) ( ( stop - start ) + 1 ) ) , out var span , ResultType . Array ) ;
734733 LRange ( client . Database , key , start , span ) ;
735734 return arr ;
736735 }
@@ -775,9 +774,9 @@ protected virtual TypedRedisValue Config(RedisClient client, in RedisRequest req
775774 OnUpdateServerConfiguration ( ) ;
776775 var config = ServerConfiguration ;
777776 var matches = config . CountMatch ( pattern ) ;
778- if ( matches == 0 ) return TypedRedisValue . EmptyArray ;
777+ if ( matches == 0 ) return TypedRedisValue . EmptyArray ( ResultType . Map ) ;
779778
780- var arr = TypedRedisValue . Rent ( 2 * matches , out var span ) ;
779+ var arr = TypedRedisValue . Rent ( 2 * matches , out var span , ResultType . Map ) ;
781780 int index = 0 ;
782781 foreach ( var pair in config . Wrapped )
783782 {
@@ -967,8 +966,8 @@ protected virtual TypedRedisValue Keys(RedisClient client, in RedisRequest reque
967966 if ( found == null ) found = new List < TypedRedisValue > ( ) ;
968967 found . Add ( TypedRedisValue . BulkString ( key . AsRedisValue ( ) ) ) ;
969968 }
970- if ( found == null ) return TypedRedisValue . EmptyArray ;
971- return TypedRedisValue . MultiBulk ( found ) ;
969+ if ( found == null ) return TypedRedisValue . EmptyArray ( ResultType . Array ) ;
970+ return TypedRedisValue . MultiBulk ( found , ResultType . Array ) ;
972971 }
973972 protected virtual IEnumerable < RedisKey > Keys ( int database , in RedisKey pattern ) => throw new NotSupportedException ( ) ;
974973
@@ -1063,7 +1062,7 @@ protected virtual TypedRedisValue MemoryPurge(RedisClient client, in RedisReques
10631062 protected virtual TypedRedisValue Mget ( RedisClient client , in RedisRequest request )
10641063 {
10651064 int argCount = request . Count ;
1066- var arr = TypedRedisValue . Rent ( argCount - 1 , out var span ) ;
1065+ var arr = TypedRedisValue . Rent ( argCount - 1 , out var span , ResultType . Map ) ;
10671066 var db = client . Database ;
10681067 for ( int i = 1 ; i < argCount ; i ++ )
10691068 {
@@ -1096,10 +1095,10 @@ protected virtual TypedRedisValue Quit(RedisClient client, in RedisRequest reque
10961095 [ RedisCommand ( 1 , LockFree = true ) ]
10971096 protected virtual TypedRedisValue Role ( RedisClient client , in RedisRequest request )
10981097 {
1099- var arr = TypedRedisValue . Rent ( 3 , out var span ) ;
1098+ var arr = TypedRedisValue . Rent ( 3 , out var span , ResultType . Array ) ;
11001099 span [ 0 ] = TypedRedisValue . BulkString ( "master" ) ;
11011100 span [ 1 ] = TypedRedisValue . Integer ( 0 ) ;
1102- span [ 2 ] = TypedRedisValue . EmptyArray ;
1101+ span [ 2 ] = TypedRedisValue . EmptyArray ( ResultType . Array ) ;
11031102 return arr ;
11041103 }
11051104
@@ -1123,7 +1122,7 @@ protected virtual TypedRedisValue Unsubscribe(RedisClient client, in RedisReques
11231122
11241123 private TypedRedisValue SubscribeImpl ( RedisClient client , in RedisRequest request )
11251124 {
1126- var reply = TypedRedisValue . Rent ( 3 * ( request . Count - 1 ) , out var span ) ;
1125+ var reply = TypedRedisValue . Rent ( 3 * ( request . Count - 1 ) , out var span , ResultType . Array ) ;
11271126 int index = 0 ;
11281127 request . TryGetCommandBytes ( 0 , out var cmd ) ;
11291128 var cmdString = TypedRedisValue . BulkString ( cmd . ToArray ( ) ) ;
@@ -1163,7 +1162,7 @@ protected virtual TypedRedisValue Time(RedisClient client, in RedisRequest reque
11631162 var ticks = delta . Ticks ;
11641163 var seconds = ticks / TimeSpan . TicksPerSecond ;
11651164 var micros = ( ticks % TimeSpan . TicksPerSecond ) / ( TimeSpan . TicksPerMillisecond / 1000 ) ;
1166- var reply = TypedRedisValue . Rent ( 2 , out var span ) ;
1165+ var reply = TypedRedisValue . Rent ( 2 , out var span , ResultType . Array ) ;
11671166 span [ 0 ] = TypedRedisValue . BulkString ( seconds ) ;
11681167 span [ 1 ] = TypedRedisValue . BulkString ( micros ) ;
11691168 return reply ;
0 commit comments