Make poll() the default
select() can still be enabled by defining CPPHTTPLIB_USE_SELECT.
This commit is contained in:
parent
32bf5c9c09
commit
e0e7ebcf29
@ -2,7 +2,7 @@ FROM yhirose4dockerhub/ubuntu-builder AS builder
|
|||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY httplib.h .
|
COPY httplib.h .
|
||||||
COPY docker/main.cc .
|
COPY docker/main.cc .
|
||||||
RUN g++ -std=c++23 -static -o server -O2 -I. -DCPPHTTPLIB_USE_POLL main.cc && strip server
|
RUN g++ -std=c++23 -static -o server -O2 -I. main.cc && strip server
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY --from=builder /build/server /server
|
COPY --from=builder /build/server /server
|
||||||
|
|||||||
@ -872,10 +872,10 @@ res->body; // Compressed data
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Use `poll` instead of `select`
|
Use `select()` instead of `poll()`
|
||||||
------------------------------
|
----------------------------------
|
||||||
|
|
||||||
`select` system call is used as default since it's more widely supported. If you want to let cpp-httplib use `poll` instead, you can do so with `CPPHTTPLIB_USE_POLL`.
|
cpp-httplib defaults to the widely supported `poll()` system call. If your OS lacks support for `poll()`, define `CPPHTTPLIB_USE_SELECT` to use `select()` instead.
|
||||||
|
|
||||||
Unix Domain Socket Support
|
Unix Domain Socket Support
|
||||||
--------------------------
|
--------------------------
|
||||||
|
|||||||
@ -145,6 +145,12 @@
|
|||||||
#define CPPHTTPLIB_LISTEN_BACKLOG 5
|
#define CPPHTTPLIB_LISTEN_BACKLOG 5
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(CPPHTTPLIB_USE_POLL) && !defined(CPPHTTPLIB_USE_SELECT)
|
||||||
|
#define CPPHTTPLIB_USE_POLL
|
||||||
|
#elif defined(CPPHTTPLIB_USE_POLL) && defined(CPPHTTPLIB_USE_SELECT)
|
||||||
|
#error "CPPHTTPLIB_USE_POLL and CPPHTTPLIB_USE_SELECT are mutually exclusive"
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Headers
|
* Headers
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user