Skip to content
Browse files

Fixed a bug discovered with Valgrind.

  • Loading branch information...
1 parent 0f036fb commit 2c3d0b53d948aad6e4713521216ec9c02314b245 Roberto Peon committed Dec 17, 2012
Showing with 13 additions and 6 deletions.
  1. +13 −6 example_code/spdy4_headers_codec.cc
View
19 example_code/spdy4_headers_codec.cc
@@ -626,11 +626,7 @@ class SPDY4HeadersCodecImpl : public Storage::ValEntryRemovalInterface {
++i) {
ExecuteToggle(group_id, *i);
}
- for (vector<ToggleOp>::const_iterator i = instrs.toggle_offs.begin();
- i != instrs.toggle_offs.end();
- ++i) {
- ExecuteToggle(group_id, *i);
- }
+ ExecuteTurnOffs(group_id, instrs);
ExecuteClones(group_id, instrs.clones);
for (vector<KVStoOp>::const_iterator i = instrs.kvstos.begin();
i != instrs.kvstos.end();
@@ -640,6 +636,15 @@ class SPDY4HeadersCodecImpl : public Storage::ValEntryRemovalInterface {
// not executing erefs here.
}
+ void ExecuteTurnOffs(GroupId group_id,
+ const Instructions& instrs) {
+ for (vector<ToggleOp>::const_iterator i = instrs.toggle_offs.begin();
+ i != instrs.toggle_offs.end();
+ ++i) {
+ ExecuteToggle(group_id, *i);
+ }
+ }
+
void ExecuteInstructions(GroupId group_id,
const Instructions& instrs,
HeaderFrame* ephemereal_headers) {
@@ -766,9 +771,11 @@ class SPDY4HeadersCodecImpl : public Storage::ValEntryRemovalInterface {
// Note that this is done after doing deletions due to exceeding the max
// buffer size, since some of the deletions may have already cleared some of
// the elements we must be turning off.
- DiscoverTurnOffs(&(instrs.toggle_offs), group_id);
+
ExecuteInstructionsExceptERefs(group_id, instrs);
+ DiscoverTurnOffs(&(instrs.toggle_offs), group_id);
+ ExecuteTurnOffs(group_id, instrs);
for (vector<LookupCache>::iterator key_lu_it = key_lookups.begin();
key_lu_it != key_lookups.end();

0 comments on commit 2c3d0b5

Please sign in to comment.
Something went wrong with that request. Please try again.