jerryscript-project / iotjs

Platform for Internet of Things with JavaScript http://www.iotjs.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid http response with slow network

lauriro opened this issue · comments

server.js

var fs = require("fs")
require("http").createServer(function(request, response) {
        fs.createReadStream("10mb.file").pipe(response)
})
.listen(8080)
# reading file fast results correct hash
$ curl -s http://localhost:8000/ | sha1sum
39c380826c78c5631ad3a922b22e1363596e5dd7  -
$ cat 10mb.file | pv -L 2m | sha1sum
39c380826c78c5631ad3a922b22e1363596e5dd7  -
# reading file slow results different hash each time
$ curl -s http://localhost:8000/ | pv -L 1m | sha1sum
a1c72482a927f1c2e45f674496873608b1bf571f  -
$ curl -s http://localhost:8000/ | pv -L 1m | sha1sum
30137c13f61dcb3766ae1b8e1a90d22f6887924e  -