lua-resty-upload
lua-resty-upload copied to clipboard
Got "closed" error after call read method of resty.upload
Hi, I encountered an occasional problem in a http request, the following is the sample code
local upload = require "resty.upload"
local form, err = upload.new(4 * 1024)
****
form:set_timeout(5000)
local typ, res, err = form:read()
The value of err is "closed", then server return a message(by using ngx.print and ngx.exit(ngx.HTTP_OK)) and client can receive it. It seems that the socket was closed but client can still get the return of server
It's easiest to use OpenResty XRay to analyze such things. We can give you a free trial to track this down for you.
I also have this problem
I want lua http client send file to lua server, i cannot find any example with lua-resty-http to send file , So I assembled the HTTP message myself and used the lua-resty-upload server to receive it. Similarly, an error is reported in form read, and err msg is sock is closed