-
Notifications
You must be signed in to change notification settings - Fork 0
TechGuyVN Changes #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ck and sendError - Add cleanup_complete check in timeoutCallback to prevent use-after-free - Add exception handling in timeoutCallback and pingCallback - Add cleanup_complete check in sendError before locking mutex - Add exception handling when locking callback_mutex in sendError - Cancel timeout_event and ping_event in disconnect() before cleanup - Prevents crashes when timeoutCallback is called on destroyed object
… safety - Add try-catch blocks around event_thread->join() in disconnect() to prevent crashes - Add exception handling in both normal path and helper thread path - Ensure event_thread is checked before deletion - Add version markers for debugging (VietHQ version 1.1) - Prevents crashes when joining threads that are being destroyed
…send - Add cleanup_complete check at start of sendData() to prevent operations on destroyed object - Add cleanup_complete check before and after bufferevent_lock() in sendData() - Wrap bufferevent_lock/unlock in try-catch to handle destroyed bufferevent - Add cleanup_complete check in send() before writing to evbuffer - Wrap all evbuffer_add() calls in try-catch to prevent crashes - Prevents crashes when sendData/send are called during object destruction
- Set cleanup_complete AFTER close() but BEFORE bufferevent_lock in disconnect() - This prevents sendData() from locking bufferevent while disconnect() is running - Add multiple cleanup_complete checks in sendData() before attempting lock - Wrap bufferevent_lock in disconnect() with try-catch to handle destroyed bufferevent - Prevents deadlock when multiple threads try to lock bufferevent during destruction
- Add cleanup_complete check at start of handleEvent() to prevent all operations when destroying - Add cleanup_complete check before processing BEV_EVENT_ERROR to ignore Broken pipe after EOF - Add cleanup_complete check before processing BEV_EVENT_EOF - Wrap close callback invocation in try-catch to prevent exceptions from crashing - Prevents crash when Broken pipe error occurs after connection is closed (EOF)
…struction - Change from lock_guard to unique_lock with try_to_lock in sendError - Prevents blocking or crash if callback_mutex is being destroyed - Double-check cleanup_complete after acquiring lock - Release lock before calling callback to avoid deadlock - Set cleanup_complete BEFORE canceling events to ensure callbacks see flag - Prevents crash when timeoutCallback calls sendError after object destruction
- Check for FreeSWITCH headers (SWITCH_LOG_DEBUG) to detect FreeSWITCH build - Use switch_log_printf when FreeSWITCH is available instead of syslog/stdout - Enable debug logs to appear in FreeSWITCH logs with mod_audio_stream prefix - Fallback to syslog/stdout when not building with FreeSWITCH - Allows WebSocketClient logs to be visible in FreeSWITCH console/logs
- Add log_info() function that always works (not dependent on LIBWSC_USE_DEBUG) - Change disconnect() entry log from log_debug to log_info for visibility - Change cleanup() logs from log_debug to log_info for visibility - Change sendError cleanup check log from log_debug to log_info - Logs will now appear in FreeSWITCH even without debug level enabled
- Add WebSocketClientWrapper.h and .cpp to replace libwsc WebSocketClient - Integrate libwebsockets library for WebSocket client functionality - Update CMakeLists.txt to find and link libwebsockets - Maintain same interface as WebSocketClient for compatibility
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
No description provided.