Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

http_patch.lua breaks socket.http with error socket/http.lua:127: attempt to call local 'create' (a nil value) #62

Open
credomane opened this issue Aug 19, 2020 · 0 comments

Comments

@credomane
Copy link

Seems the the /support/http_patch.lua is broken on newer luasocket revisions. My distro recently updated luasocket to the version you can find on this github page or directly at http.lua. OCEmu quit working with the error in the title.

After spending all night and a lunch break on it. I figured it all out shortly after discovering OCemu patches the loaded socket.http.

The fix I employed is this:
Updating line https://github.com/gamax92/OCEmu/blob/82defa8c6bba1089ece327e62db30dbe3168fcdf/src/support/http_patch.lua#L10 to instead of saying create = nil to create = socket.tcp fixed the issue right up. Seems the current luasocket revision expects create to always exist as a function because it never checks that it is actually a function before calling it. A function, btw, which seems to always be socket.tcp. Why they added this extra hop reach socket.tcp I have no idea.

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

No branches or pull requests

1 participant