Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bugs that were pointed out by Takeshi Yoshino from spdy-dev.
  • Loading branch information
fenix-f38 committed Oct 24, 2012
1 parent 5d19f78 commit fdd7c78
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions example_code/spdy4_headers_codec.cc
Expand Up @@ -329,7 +329,7 @@ class Storage {
if (lc->k_i_valid == false) {
lc->k_i = keymap.find(key);
if (lc->k_i == keymap.end()) {
MakeSpace(key.size(), 1);
MakeSpace(key.size(), 0);
lc->k_i = keymap.insert(make_pair(key,
KeyEntry(key_ids.GetNext()))).first;
state_size += key.size();
Expand All @@ -344,7 +344,7 @@ class Storage {

lc->k_i->second.refcnt++;
ValEntry* entry = new ValEntry;
MakeSpace(val.size(), 0);
MakeSpace(val.size(), 1);
lc->k_i->second.refcnt--;

lc->v_i = lc->k_i->second.valmap.insert(make_pair(val, entry));
Expand Down Expand Up @@ -429,6 +429,7 @@ class Storage {
<< "\n";
#endif
key_ids.DoneWithId(keyentry.key_idx);
state_size -= entry->k_i->first.size();
keymap.erase(entry->k_i);
entry->k_i = keymap.end();
}
Expand Down Expand Up @@ -1286,8 +1287,11 @@ SPDY4HeadersCodecImpl::~SPDY4HeadersCodecImpl() {
// 5) huffman-encoded strings use an EOF symbol is used to indicate the end of
// the string
// 6) a bit-width or token-count is used to indicate the end of the string.
// 7) var-int length fields instead of fixed-width length fields
// 8) huffman-coding over the opcodes and fixed-width values.
// 7) va
// r-int length fields instead of fixed-width length fields
// I done know what I want to type here.
// 8) huffman-coding over the opcodes a
// nd fixed-width values.
// this list is not exhaustive, but I'm exhausted, so I'll stop here. This should
// be plenty to play around with.

Expand All @@ -1309,10 +1313,10 @@ size_t SPDY4HeadersCodec::CurrentStateSize() const {
}

void SPDY4HeadersCodec::OutputCompleteHeaderFrame(OutputStream* os,
StreamId stream_id,
GroupId group_id,
const HeaderFrame& headers,
bool this_ends_the_frame) {
StreamId stream_id,
GroupId group_id,
const HeaderFrame& headers,
bool this_ends_the_frame) {
impl->OutputCompleteHeaderFrame(os, stream_id, group_id,
headers, this_ends_the_frame);
}
Expand Down

0 comments on commit fdd7c78

Please sign in to comment.