Skip to content

Add PSR-18 HTTP Client, PSR-17 Factories, URI Implementation & Performance Optimizations#9

Merged
yordadev merged 2 commits into
mainfrom
feat-main-psr-18-client-addition
Jan 16, 2026
Merged

Add PSR-18 HTTP Client, PSR-17 Factories, URI Implementation & Performance Optimizations#9
yordadev merged 2 commits into
mainfrom
feat-main-psr-18-client-addition

Conversation

@yordadev

Copy link
Copy Markdown
Contributor

Summary

Major feature release adding PSR-18 HTTP Client support, PSR-17 Factory implementations, full URI interface, and significant performance optimizations to the signalforge_http C extension.

New Features:

  • PSR-18 compliant HTTP Client with libcurl backend
  • HttpRequestPool for concurrent request execution with thread pool
  • PSR-17 Factory implementations (RequestFactory, ResponseFactory, StreamFactory, UriFactory, etc.)
  • Full PSR-7 UriInterface implementation with RFC 3986 compliance
  • Connection sharing and keep-alive support
  • Automatic retry with exponential backoff
  • HTTP/2 and HTTP/3 support (when available)

Performance Optimizations:

  • Header normalization caching for faster lookups
  • getHeaders() array caching to avoid repeated rebuilds
  • Interned strings for common header names (content-type, location)
  • Increased stream buffer size (64KB → 256KB) for large payloads
  • Optimized header lookup using simple lowercase conversion

Security Hardening:

  • URI injection prevention (blocks CRLF, null bytes, control characters)
  • Host header validation
  • User info validation

Infrastructure:

  • Fixed Dockerfile.valgrind to include --enable-signalforge-http-client
  • Added examples/basic.php demonstrating all extension features
  • Extended test suite from ~97 to 206 tests

@yordadev yordadev self-assigned this Jan 16, 2026
@yordadev yordadev added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 16, 2026
@yordadev yordadev merged commit 9c8eabf into main Jan 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant