Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
b73d231b
Commit
b73d231b
authored
Jul 05, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avoid stackoverflow around ParseRedisStreamEntries
parent
3627d330
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
ISubscriber.cs
...hange.Redis/StackExchange/Redis/Interfaces/ISubscriber.cs
+2
-2
RawResult.cs
StackExchange.Redis/StackExchange/Redis/RawResult.cs
+0
-8
ResultProcessor.cs
StackExchange.Redis/StackExchange/Redis/ResultProcessor.cs
+8
-2
No files found.
StackExchange.Redis/StackExchange/Redis/Interfaces/ISubscriber.cs
View file @
b73d231b
...
...
@@ -56,7 +56,7 @@ public interface ISubscriber : IRedis
Task
<
long
>
PublishAsync
(
RedisChannel
channel
,
RedisValue
message
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// Subscribe to perform some operation when a
change to the preferred/active node is broadcast
.
/// Subscribe to perform some operation when a
message to the preferred/active node is broadcast, without any guarantee of ordered handling
.
/// </summary>
/// <param name="channel">The channel to subscribe to.</param>
/// <param name="handler">The handler to invoke when a message is received on <paramref name="channel"/>.</param>
...
...
@@ -66,7 +66,7 @@ public interface ISubscriber : IRedis
void
Subscribe
(
RedisChannel
channel
,
Action
<
RedisChannel
,
RedisValue
>
handler
,
CommandFlags
flags
=
CommandFlags
.
None
);
/// <summary>
/// Subscribe to perform some operation when a
change to the preferred/active node is broadcast, as a channel
.
/// Subscribe to perform some operation when a
message to the preferred/active node is broadcast, as a queue that guarantees ordered handling
.
/// </summary>
/// <param name="channel">The redis channel to subscribe to.</param>
/// <param name="flags">The command flags to use.</param>
...
...
StackExchange.Redis/StackExchange/Redis/RawResult.cs
View file @
b73d231b
...
...
@@ -390,14 +390,6 @@ internal bool TryGetInt64(out long value)
_payload
.
CopyTo
(
span
);
return
RedisValue
.
TryParseInt64
(
span
,
out
value
);
}
internal
static
RawResult
CreateMultiBulk
(
RawResult
rawResult0
,
RawResult
rawResult1
)
{
var
arr
=
ArrayPool
<
RawResult
>.
Shared
.
Rent
(
2
);
arr
[
0
]
=
rawResult0
;
arr
[
1
]
=
rawResult1
;
return
new
RawResult
(
arr
,
2
);
}
}
}
StackExchange.Redis/StackExchange/Redis/ResultProcessor.cs
View file @
b73d231b
using
System
;
using
System.Buffers
;
using
System.Collections.Generic
;
using
System.Diagnostics
;
using
System.IO
;
...
...
@@ -1584,9 +1585,14 @@ protected override bool SetResultCore(PhysicalConnection connection, Message mes
// Items 9-12 represent the first and last entry in the stream. The values will
// be nil (stored in index 9 & 11) if the stream length is 0.
var
tmp
=
RawResult
.
CreateMultiBulk
(
arr
[
9
],
arr
[
11
]);
var
leased
=
ArrayPool
<
RawResult
>.
Shared
.
Rent
(
2
);
leased
[
0
]
=
arr
[
9
];
leased
[
1
]
=
arr
[
11
];
var
tmp
=
new
RawResult
(
leased
,
2
);
var
entries
=
ParseRedisStreamEntries
(
tmp
);
tmp
.
Recycle
();
// note: don't .Recycle(), would be a stack overflow because
// it would bridge the fake and real result set
ArrayPool
<
RawResult
>.
Shared
.
Return
(
leased
);
var
streamInfo
=
new
StreamInfo
(
length
:
(
int
)
arr
[
1
].
AsRedisValue
(),
radixTreeKeys
:
(
int
)
arr
[
3
].
AsRedisValue
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment