Skip to content

Conversation

@Bilal2453
Copy link
Contributor

@Bilal2453 Bilal2453 commented Sep 17, 2025

fixes #341

Implements the same fix described in the issue #341, and refactors the whole biowrap code. Should be now slightly cleaner so I don't have to spend 4 days debugging something like this again (hopefully).

testing

  • Lit tests regarding HTTP/s pass.
  • Using the reproduction code provided in the original issue is now solved.

key changes

  • secure socket now transparently exposes the underlying uv socket using a metamethod.
  • biowrap's interface gets the original options argument now, this is both cleaner and allows us to do more advanced things, such as allowing the user in the future to specify the verify_mode / insecure mode or the ability to do SNI. This shouldn't be breaking, since biowrap.lua is an internal interface only.
  • connection state is now tracked and upvalue states are now ssocket states.
  • when a reader is assigned, we now peek into the ssl buffer and defer a read cb call fixing the main issue.
  • changed the package url, it is now under lit not luvit.

Also added the TODOs I could think of as I was browsing the code, hopefully I will implement those later on, most importantly we handle none of the shutdowns right now.

questions

I am not entirely sure if the timer solution is perfect, we can't use a normal coroutine, so the only way I could think of to defer this callback is a timer, I assume I also don't have to manually close the timer handle after it finishes?

@Bilal2453
Copy link
Contributor Author

Does the requested changes require adding further tests @squeek502 ?

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

Successfully merging this pull request may close these issues.

secure socket: indefinite hangs with an https web server

1 participant