Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

https: can not handle large data #490

Open
littleGauze opened this issue Feb 18, 2019 · 2 comments
Open

https: can not handle large data #490

littleGauze opened this issue Feb 18, 2019 · 2 comments

Comments

@littleGauze
Copy link

  • Version: v0.10.8(linux), v0.9.0(mac)
  • Platform: Linux buildroot 4.9.54 merge to master #1 SMP PREEMPT Mon Oct 15 18:58:09 HKT 2018 aarch64 GNU/Linux, Darwin liningdeMacBook-Pro.local 18.0.0 Darwin Kernel Version 18.0.0: Wed Aug 22 20:13:40 PDT 2018; root:xnu-4903.201.2~1/RELEASE_X86_64 x86_64
  • Subsystem:

https: can not handle large data, I can't get all the data chunk when fetch large data, it's pending all the time.

here is my code:

// https://s.rokidcdn.com/homebase/upload/KDKs0M1_W.json // large data
// https://s.rokidcdn.com/homebase/upload/XYbP8HhjV.json // small data

var https = require('https')
var url = 'https://s.rokidcdn.com/homebase/upload/KDKs0M1_W.json'

var req = https.request(url, (res) => {
  console.log('statusCode:', res.statusCode)
  console.log('data length ========= ', res.headers['content-length'])

  var body = []
  res.on('data', chunk => {
    body.push(chunk)
    console.log('chunk length === ', chunk.length, Buffer.concat(body).length)
  })

  res.on('end', _ => {
    console.log('on end ===========')
    console.log(Buffer.concat(body).toString())
  })
})

req.on('error', e => {
  console.error(e)
})

req.end()

and here is the log when run the script:

iotjs req.js
statusCode: 200
data length =========  191561
chunk length ===  499 499
chunk length ===  1400 1899
chunk length ===  1400 3299
chunk length ===  1400 4699
chunk length ===  1400 6099
chunk length ===  1400 7499
chunk length ===  1400 8899
chunk length ===  1400 10299
chunk length ===  1400 11699
chunk length ===  1400 13099
chunk length ===  1400 14499
chunk length ===  1400 15899
chunk length ===  1400 17299
chunk length ===  1400 18699
chunk length ===  1400 20099
chunk length ===  1400 21499
chunk length ===  1400 22899
chunk length ===  1400 24299
chunk length ===  1400 25699
chunk length ===  1400 27099
chunk length ===  1400 28499

then it's pending all the time.

@legendecas
Copy link
Contributor

legendecas commented Feb 22, 2019

Tested over http, it works. Should be confirmed if it's related to tls or https.

@qile222
Copy link
Contributor

qile222 commented Feb 22, 2019

so the upper limit of download is only 28KB?
is there any testing for upload upper limit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants