Skip to content

Conversation

@bryghtlabs-richard
Copy link
Contributor

Checklist

  • Component contains License
  • Component contains README.md
  • Component contains idf_component.yml file with url field defined
  • Component was added to upload job
  • Component was added to build job
  • Optional: Component contains unit tests
  • CI passing

Change description

Enable processing received HTTP client traffic before sending HTTP client traffic. This can reduce latency in a few cases:

  • When HTTP response triggers queueing a new HTTP request
  • When HTTP client wants to reset stream without resetting connection
  • When partial HTTP response is received, and HTTP client needs to send WINDOW_UPDATE

@bryghtlabs-richard bryghtlabs-richard changed the title ESP32: extend sh2lib with distinct recv and send funcs feat(shlib2): distinct recv and send funcs Nov 24, 2025
@bryghtlabs-richard bryghtlabs-richard changed the title feat(shlib2): distinct recv and send funcs feat(sh2lib): distinct recv and send funcs Nov 24, 2025
@github-actions github-actions bot changed the title feat(sh2lib): distinct recv and send funcs feat(sh2lib): distinct recv and send funcs (IEC-429) Nov 24, 2025
sh2lib_execute() processes send, then recv. This is fine
for a general purpose connection, but can lead to code like:

loop:
  1) sh2lib_execute()
  2) based on handler called in (1), sh2lib_do_get/post()
  3) do other system task

^^This means that any requests queued in (2) cannot be sent
until the next sh2lib_execute(). Instead, this commit
splits sh2lib_execute() into distinct _send() and _recv()
phases, so client use this pattern, which reduces latency
between request generation in (2) and request sending in(3):

loop:
  1) sh2lib_execute_recv()
  2) based on handler called in (1), sh2lib_do_get/post()
  3) sh2lib_execute_send()
  4) do other system task
When `sh2lib_execute*(NULL);` occurs, log an error instead of crashing.

See: espressif#623 (comment)
@mahavirj mahavirj merged commit 4181ca4 into espressif:master Nov 26, 2025
85 checks passed
@bryghtlabs-richard bryghtlabs-richard deleted the feat/sh2lib/splitSendRecv branch November 26, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants