esp-rs / esp-mbedtls

mbedtls for ESP32 bare-metal
Apache License 2.0
21 stars 10 forks source link

revert: Changes Session back to own the socket #25

Closed AnthonyGrondin closed 8 months ago

AnthonyGrondin commented 8 months ago

This was done as a fix for the server, but it seems that letting T and simply passing &mut T fixes the original issue this PR was intended to fix.

Other libraries like embedded_tls take ownership of the socket. This allows to move the session around without having to keep a reference to the socket alive.

I've ran the justfile and everything compiles. This unblocks my fork of reqwless that attempts to use esp-mbedtls as a TLS wrapper (coming soon).

Ref: c094cfc

bjoernQ commented 8 months ago

I think the build fails because of the changes around atomics (not related to this PR). We probably need to update the HAL dependencies and remove the atomic-emulation configs from .cargo/config.toml

Code changes look good to me