Make request.Request smaller (#3351)

* Make request.Request smaller

This makes the request struct smaller and removes the pointer to the do
boolean (tri-bool) as size == 0 will indicate if we have cached it.

Family can be a int8 because it only carries 3 values, Size itself is
just a uint16 under the covers.

This is a more comprehensive fix than #3292

Closes #3292

Signed-off-by: Miek Gieben <miek@miek.nl>

* cache: fix test

this now needs a valid response writter

Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
Miek Gieben 2019-10-04 09:44:58 +01:00 committed by GitHub
parent f8551df272
commit 03ea2ae955
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 28 deletions

View file

@ -13,7 +13,7 @@ func TestRequestDo(t *testing.T) {
st := testRequest()
st.Do()
if st.do == nil {
if !st.do {
t.Errorf("Expected st.do to be set")
}
}