scripts : use official split.py for cpp-httplib (#19588)

* scripts : use official split.py for cpp-httplib

Using the official script is safer and ensures the generated code aligns
with the library's standards.

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

* Catch generic errors

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

* Allow print()

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

* Ensure robust cleanup

Signed-off-by: Adrien Gallouët <angt@huggingface.co>

---------

Signed-off-by: Adrien Gallouët <angt@huggingface.co>
This commit is contained in:
Adrien Gallouët 2026-02-14 08:41:16 +01:00 committed by GitHub
parent 0d00ef65ed
commit c7db95f106
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 19 additions and 20 deletions

View file

@ -1,7 +1,6 @@
#include "httplib.h"
namespace httplib {
/*
* Implementation that will be part of the .cc file if split into .h + .cc.
*/
@ -1219,7 +1218,7 @@ int close_socket(socket_t sock) {
#endif
}
template <typename T> inline ssize_t handle_EINTR(T fn) {
template <typename T> ssize_t handle_EINTR(T fn) {
ssize_t res = 0;
while (true) {
res = fn();

View file

@ -3336,7 +3336,6 @@ private:
} // namespace sse
} // namespace httplib
#endif // CPPHTTPLIB_HTTPLIB_H