0

I'm downloading quite big JSON data with luasocket (request), but sometimes, data are incomplete. There is no pattern, if X runs, I have Y fails and Z successful downloads. My downloading code looks like this:

local response = {}
local one, code, headers, status = https.request {
    url = url,
    sink = ltn12.sink.table(response)
}

And btw, everytime it fails on character 3615. Where is the problem and how to fix it? Is it issue in my code, luasocket, or server?

Pavel Štěrba
  • 2,822
  • 2
  • 28
  • 50
  • Have you tried to decompress/ compress the data? – warspyking Nov 01 '15 at 22:42
  • How it should help when I'm having problem with downloading incomplete data from 3rd party server? – Pavel Štěrba Nov 01 '15 at 22:54
  • Capture the network traffic from the failures. See what's actually happening. If it is *always* failing at exactly the same place then something is doing it. Either a network device killing the connection or something else that is happening at the same spot every time. – Etan Reisner Nov 02 '15 at 01:50

0 Answers0