Add known-failing test. Panic stack trace reported by Mathieu from Camlistore.
Add bigger TODO comment and replace 65536 with meaningful constant.
Move server's WINDOW_UPDATE sending logic into the serve loop.

Previously the http.Handler (via requestBody) were just blinding
writing telling the serve loop to send the WINDOW_UPDATE frames, but
the serve loop didn't really know what was going on.

Now the requestBody.Read instead tells the serve loop that n bytes
were read on a given stream, so the server can be smarter.

This opens the door to coalescing updates, and suppressing pointless
ones (like the new TODO notes: no need to send a stream-specific
WINDOW_UPDATE when the peer has closed their side already)

No (intentional) changes in behavior in this change, though.
Updated TODO
New TODO, related to a known crash
Fix copy/paste typo in server_test.go
Don't send stream WINDOW_UPDATEs when client has sent END_STREAM

It's useless to tell them they can send more, when they've already
said they're done.
Remove a TODO that's already done.
Add a TODO about crypto/tls.Conn.CloseWrite
remove back-to-back map lookup in processResetStream
Make the currently-skipped known-failing test actually fail.

Before it was marked as skipped until we could fix it, but if you
forced it to run, it should print out a panic stack trace and then say
PASS. So this makes it actually fail.

Actual fix coming later, now that we have an actual failing list.
Fix a crash and state transitions when handler closes while client still open

From the commit:

// This previously crashed (reported by Mathieu Lonjaret as observed
// while using Camlistore) because we got a DATA frame from the client
// after the handler exited and our logic at the time was wrong,
// keeping a stream in the map in stateClosed, which tickled an
// invariant check later when we tried to remove that stream (via
// defer sc.closeAllStreamsOnConnClose) when the serverConn serve loop
// ended.

Also adding a possible TODO at top:

// TODO (maybe): add a mechanism for Handlers to going into half-closed-local
// mode (rw.(io.Closer) test?) but not exit their handler, and
// continue to be able to read from the Request.Body. This would be a
// somewhat semantic change from HTTP/1 (or at least what we expose in
// net/http), so I'd probably want to add it there
// too. For now, this package says that returning from the Handler
// ServeHTTP function means you're both done reading and done writing,
// without a way to stop just one or the other.
Add more docs to the FrameHeader type and UnknownFrame.Payload
Add a test to catch that nobody rearranges fields in FrameHeader

So its size doesn't bloat because of alignment requirement.
Load the spec coverage in tests lazily.

It was adding noise to benchmark numbers.
Start of a server benchmark. Also, make serverTester less allocation-heavy.

The allocations from encodeHeader were noisy, and we only cared about
the server's allocations. Later the benchmark should run the client
parts in a subprocess, to remove them from the profiles entirely. But
for now just fix encodeHeader, since it should share an HPACK context
over time anyway. We only got away with the new-encoder-per-HEADER
before because the encoder was dumb and stateless, always encoding
literals. Now that that's no longer the case, the serverTester should
re-use the same context during tests. I think we've just been getting
lucky (and always using strings in the HPACK static table).
Move TLS version check much earlier, not late during handler setup.

Also saves an allocation, reusing the Request.TLS pointer between requests, like net/http.
Add tests that we reject TLS 1.0 and TLS 1.1
Enforce SNI
Enforce cipher suites.