Commit Graph

6 Commits

Author SHA1 Message Date
Haibo Chen(陈海博)
8f1578e0e3 Refactor: Rename ide/ directory to cmake/ for better clarity (#4539)
This PR renames the trunk/ide/ directory to trunk/cmake/ to better
reflect its actual purpose. The directory contains CMake build
configuration files used by multiple IDEs (CLion, VSCode), not
IDE-specific files.

* Directory rename: trunk/ide/ → trunk/cmake/
* Build output location: trunk/ide/vscode-build/ → trunk/cmake/build/
* CMakeLists.txt: Moved from trunk/ide/srs_clion/CMakeLists.txt to
trunk/cmake/CMakeLists.txt
2025-10-23 20:38:48 -04:00
Winlin
f20a1eae84 Refactor: Convert HTTP hooks from static methods to interface-based architecture. v7.0.58 (#4444)
This PR refactors the HTTP hooks system from static methods to a proper
interface-based architecture, improving code maintainability,
testability, and extensibility.

1. **Testability**: Interface allows easy mocking for unit tests
1. **Extensibility**: Custom hook implementations can be injected
1. **Maintainability**: Clear separation of concerns and better code
organization
1. **Documentation**: Comprehensive inline documentation for all hook
methods
1. **Future-proofing**: Enables plugin architecture and custom hook
handlers

---------

Co-authored-by: OSSRS-AI <winlinam@gmail.com>
2025-08-19 23:10:14 -06:00
winlin
1173560b55 AI: Add run utest in guideline for augment code. 2025-06-30 08:10:21 -04:00
winlin
5a404c089b VSCode: Support debug and run utest in VSC. 2025-05-28 18:38:56 -04:00
Winlin
4e55bc83b7 Support custom deleter for SrsUniquePtr. (#4309)
SrsUniquePtr does not support array or object created by malloc, because
we only use delete to dispose the resource. You can use a custom
function to free the memory allocated by malloc or other allocators.
```cpp
      char* p = (char*)malloc(1024);
      SrsUniquePtr<char> ptr(p, your_free_chars);
```

This is used to replace the SrsAutoFreeH. For example:
```cpp
      addrinfo* r = NULL;
      SrsAutoFreeH(addrinfo, r, freeaddrinfo);
      getaddrinfo("127.0.0.1", NULL, &hints, &r);
```

Now, this can be replaced by:
```cpp
      addrinfo* r = NULL;
      getaddrinfo("127.0.0.1", NULL, &hints, &r);
      SrsUniquePtr<addrinfo> r2(r, freeaddrinfo);
```

Please aware that there is a slight difference between SrsAutoFreeH and
SrsUniquePtr. SrsAutoFreeH will track the address of pointer, while
SrsUniquePtr will not.
```cpp
      addrinfo* r = NULL;
      SrsAutoFreeH(addrinfo, r, freeaddrinfo); // r will be freed even r is changed later.
      SrsUniquePtr<addrinfo> ptr(r, freeaddrinfo); // crash because r is an invalid pointer.
```

---------

Co-authored-by: Haibo Chen <495810242@qq.com>
Co-authored-by: john <hondaxiao@tencent.com>
2025-04-26 00:01:34 -04:00
winlin
40e8ed4586 VSCode: Support IDE vscode to run and debug. 2024-09-10 17:46:54 +08:00