Sign conversion fixes

Summary: Some type mismatches found by @pgriess.

Test Plan: fbmake runtests

Reviewed By: subodh@fb.com

Subscribers: trunkagent, pgriess, kmdent, fma, shikong, subodh, bmatheny, ranjeeth

FB internal diff: D1722229

Signature: t1:1722229:1417807133:669a7403ffbdb4292dbeea9b53cfd2a0634f127c
Finish implementing draft-9

Summary:
Update virtual methods that can be overridden by later drafts

Facebook:

Remove reference set. Change "context update" to "table size update", with 5 bit prefix.
3hrs (and waiting) for push_blocking tests is ridiculous

Test Plan: Updated unit tests to ensure we generate the same bytes as the RFC

Reviewed By: cgheorghe@fb.com

Subscribers: trunkagent, doug, bmatheny, cgheorghe

FB internal diff: D1697687

Signature: t1:1697687:1417759015:f905fe301e1226cdc10e3e030227316a95dc91fe
Expanded har test

Summary:
Added code to parse a public HTTP Archive like those found in https://github.com/http2jp/hpack-test-case

Facebook:

imported test cases and ran them against all three hpack drafts.  HPACK-05 was shown not to support duplicate headers and was disabled.

Test Plan: Unit tests

Reviewed By: cgheorghe@fb.com

Subscribers: doug, bmatheny, neal, erling, cgheorghe

FB internal diff: D1699139

Signature: t1:1699139:1417476405:b4b3517a4c6e097ee505fed714e4071da4d32645
Remove extra sort()

Summary:
The decoder was calling sort to detect multi-valued headers, which is used in SPDYCodec to find illegal duplicates.  Since duplicate header names are allowed in HPACK, just mark every header as 'multivalued'.

Facebook:

There was a bug in HTTP2Codec enforcing the order so I added a test.  It was not working because the sort was fixing the order even if the client did it wrong.

Test Plan: Unit tests

Reviewed By: cgheorghe@fb.com

Subscribers: trunkagent, doug, bmatheny, cgheorghe

FB internal diff: D1714533

Signature: t1:1714533:1417653464:ff7d793f5301c63c677bbc6e53d0712ba88fe8d4
Add a helper method to FakeCodecCallback

Summary:
For test simplification

Facebook: making HTTP2Codec test a bit simpler

Test Plan: unit tests

Reviewed By: viswanath@fb.com

Subscribers: doug, bmatheny

FB internal diff: D1723048

Signature: t1:1723048:1417821813:063f63bfbbb669cc3f1304b65e8c9ede6e958a8e
easy: log decoder table state in case of decode error

Summary: this is super useful when debugging very rare decode errors.

Test Plan: ran unit test and table shows up on console on cases with errors

Reviewed By: afrind@fb.com

Subscribers: trunkagent, doug, bmatheny, cgheorghe

FB internal diff: D1722372

Tasks: 5714696

Signature: t1:1722372:1417824826:7368988e58ddfbf51286b5b0098ca8424b2f378a
Move hpack-draft9 into OSS

Summary:
This is still somewhat experimental, proceed with caution.

Facebook:

notimetoexplain

Test Plan: Unit tests

Reviewed By: cgheorghe@fb.com

Subscribers: trunkagent, doug, bmatheny, cgheorghe

FB internal diff: D1723214

Signature: t1:1723214:1418073547:cd6989dc2f339e3087a0b7d19a4a2dd6871e131b
Move HTTP/2 implementation to OSS/experimental

Summary: This codec is still under development.  Please use appropriately and report bugs.

Test Plan: Unit tests

Reviewed By: viswanath@fb.com

Subscribers: trunkagent, doug, bmatheny

FB internal diff: D1723346

Signature: t1:1723346:1418073392:a5f876ede04926634832c53fd7b034a0c9080e3d
Add h2-14 -> HTTP/2 mapping to HTTPSessionAcceptor

Summary: This will allow you to configure an h2-14 server.  Note that both the HTTP/2 (draft-14) and HPACK (draft-9) codecs are currently experimental.

Test Plan: Unit tests

Reviewed By: cgheorghe@fb.com, viswanath@fb.com

Subscribers: trunkagent, doug, bmatheny

FB internal diff: D1723324

Signature: t1:1723324:1418073495:de1c2e1c14a363d063e355d82c2c31bd13db8f50
protect against empty header names

Summary:
if the client sends us a header block with an empty header name, we're hitting a CHECK and crashing.
Fix: detect empty header name as invalid and don't add the header to our decoded headers.

Test Plan: unit test with a spdy blob that causes a crash before the fix

Reviewed By: afrind@fb.com

Subscribers: doug, bmatheny, noamler

FB internal diff: D1725865

Tasks: 5765629

Signature: t1:1725865:1418076298:2c3cf8f242fe345e4698398c3ef2b4291285cb6c
TransportInfo size mismatches

Summary:
The code that uses TransportInfo assumes these byte counts are
compatible with size_t so make them so.

Test Plan: compiled

Reviewed By: davejwatson@fb.com

Subscribers: fugalh, bmatheny, njormrod, folly-diffs@, benyluo, ranjeeth, fma, kmdent

FB internal diff: D1725026

Tasks: 5538843

Signature: t1:1725026:1418061933:b4072ca926e792716776ddc00d79db9376510859
Bitness fixes

Summary:
Fix instances of unsafe shortening in proxygen.

Test Plan: compiled

Reviewed By: cgheorghe@fb.com

Subscribers: trunkagent, bmatheny, benyluo, ranjeeth, subodh, shikong, fma, kmdent

FB internal diff: D1725037

Tasks: 5538843

Signature: t1:1725037:1418073658:0f2d5daa2d8a2550e0bd9d367dcacae030102bf7
pull out EOS character from the Huffman table and use const int for table size instead of 256

Summary: hpack09 had a table size of 257 because it contained the EOS character, which was confusing. That character is never decoded and for encoding it's used only for padding (all 1's), so keep it as a const for reference, although it's not actually used

Test Plan: ran the unit tests for both 05 and 09

Reviewed By: afrind@fb.com

Subscribers: doug, bmatheny, cgheorghe

FB internal diff: D1731009

Signature: t1:1731009:1418236589:dcf53a4ac8cb90241e0f1eb4f801d5e95b37ef83
Change TraceEventIdGenerator to a union with placement new for shutdown safety

Summary: As title. Also changed the std::mutex and std::mt19937 as well.

Test Plan: Still passed.

Reviewed By: seanc@fb.com

Subscribers: trunkagent, bmatheny, seanc

FB internal diff: D1730862

Tasks: 5797140

Signature: t1:1730862:1418236784:d5abc5cc0ec0857eadd754259e4bf92173d01be9
shorten-64-to-32 fixes

Summary: This diff fixes shorten-64-to-32 issues in proxygen.

Test Plan: fbmake runtests

Reviewed By: pgriess@fb.com

Subscribers: trunkagent, bmatheny, cgheorghe, benyluo, kmdent, fma, ranjeeth

FB internal diff: D1730940

Signature: t1:1730940:1418316209:0a00e0ed0a51d2bda47cdc39df5de8f0df19c183
Attempt to fix OSS build

Summary: I added some sources without adding to Makefile.am

Test Plan: jenkins

Reviewed By: woo@fb.com, seanc@fb.com

Subscribers: doug, bmatheny

FB internal diff: D1732612

Tasks: 5807213

Signature: t1:1732612:1418257529:986537bb509f692929052dc272d524f0173d96f7
get rid of unused variable warning

Summary: ^

Test Plan: compiling

Reviewed By: viswanath@fb.com

Subscribers: bmatheny

FB internal diff: D1734307

Signature: t1:1734307:1418328808:35e9b5e6aa00359bae8a7e316a76137fdba52193
Bump version to 7:0