streamrelay: Update fallback scenario

  • Rework code structure using do-while(0) pattern for cleaner error handling
  • Add switch_stream_source_host() function for centralized fallback logic
  • Fix fallback host comparison using streq() instead of pointer comparison
  • Extend fallback triggers to connection failure, socket close, and bad HTTP response
  • Fix socket leaks in connect_to_stream() on setsockopt/connect failures
  • Fix memory leak in HTTP host parsing by avoiding cs_strdup allocation
  • Fix potential double-free by NULLing key pointers after dvbcsa_bs_key_free()
  • Add http_log() helper function to prevent memory leaks in debug logging
  • Add safety checks for file descriptors before close operations
  • Improve code formatting and reduce duplication
Edited by WXbet

Merge request reports

Loading