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

Got "closed" error after call read method of resty.upload #57

Open
GeraltXLi opened this issue Jul 21, 2020 · 3 comments
Open

Got "closed" error after call read method of resty.upload #57

GeraltXLi opened this issue Jul 21, 2020 · 3 comments

Comments

@GeraltXLi
Copy link

GeraltXLi commented Jul 21, 2020

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

@agentzh
Copy link
Member

agentzh commented Jul 21, 2020

It's easiest to use OpenResty XRay to analyze such things. We can give you a free trial to track this down for you.

@xiaoliu10
Copy link

I also have this problem

@xiaoliu10
Copy link

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

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

No branches or pull requests

3 participants