Skip to content

kruftik/go-ipp-panics-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-ipp / http.Response.Body strange reads example

  • all go-ipp prepare request logic is omitted to simplify the example
  • cupsRequestBody is a wireshark-dumped http-body of GetPrinters request to CUPS.
  • printers.conf contains 1446 printers defined.

run local CUPS instance in a container

docker-compose up -d

run test cases

TestMainDirect test

direct http.Response.Body parsing, without buffering

# run the test 100 times, multiple (or even all) fails are expected
go test -run TestMainDirect -count 100

TestMainPreread test

read entire http.Response.Body into a byte slice, parse bytes.NewReader of that slice.

# run the test 100 times, none of the tries are expected to fail
go test -run TestMainDirect -count 100

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages