Clean up http header initialization code
commit25c9bf57ef9c10e9dd33eec686d11adf959afc98
authorBrett Simmers <bsimmers@fb.com>
Mon, 14 Oct 2013 23:15:23 +0000 (14 16:15 -0700)
committerSara Golemon <sgolemon@fb.com>
Fri, 18 Oct 2013 03:27:22 +0000 (17 20:27 -0700)
tree0931f63a3a2820d12d09f3b3240ee7f35e686d89
parentba6bc49e636d770dfec876250f0be63fe743dd8c
Clean up http header initialization code

This diff fixes a few things I ran into while debugging an unrelated
issue:
- The request counter was global and not synchronized. It's not critical for
  there to be no races on this counter but it's not a perf-sensitive path so I
  can't see any reason to not fix it.
- The HeaderMangle warning is now more informative, including the entire set of
  received headers. It also prints at most one warning per request, though that
  warning may have multiple lines.
- The code to actually put the headers in $_SERVER['HTTP_*'] was looping over
  the vector of values for each header, assigning each one to the same key in
  $_SERVER. Unless I'm missing something really subtle, this is equivalent to
  just assigning the final element of the vector to the key, so I changed it to
  do that.

Reviewed By: @markw65

Differential Revision: D1010458
hphp/runtime/server/http-protocol.cpp