mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 09:58:03 +02:00
e0eba8ce21
```bash find . -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) ! -path "src/3rdparty/*" -print0 | xargs -0 clang-format -i ```
39 lines
1003 B
C
39 lines
1003 B
C
#pragma once
|
|
|
|
#include "common/thread.h"
|
|
#include "common/FFstrbuf.h"
|
|
|
|
#ifdef _WIN32
|
|
# include <minwindef.h>
|
|
#endif
|
|
|
|
struct addrinfo;
|
|
|
|
typedef struct FFNetworkingState {
|
|
#ifdef _WIN32
|
|
uintptr_t sockfd;
|
|
OVERLAPPED overlapped;
|
|
#else
|
|
int sockfd;
|
|
struct addrinfo* addr;
|
|
|
|
# ifdef FF_HAVE_THREADS
|
|
FFThreadType thread;
|
|
# endif
|
|
#endif
|
|
|
|
FFstrbuf command;
|
|
uint32_t timeout;
|
|
bool ipv6;
|
|
bool compression; // if true, HTTP content compression will be enabled if supported
|
|
bool tfo; // if true, TCP Fast Open will be attempted first, and fallback to traditional connection if it fails
|
|
} FFNetworkingState;
|
|
|
|
const char* ffNetworkingSendHttpRequest(FFNetworkingState* state, const char* host, const char* path, const char* headers);
|
|
const char* ffNetworkingRecvHttpResponse(FFNetworkingState* state, FFstrbuf* buffer);
|
|
|
|
#ifdef FF_HAVE_ZLIB
|
|
const char* ffNetworkingLoadZlibLibrary(void);
|
|
bool ffNetworkingDecompressGzip(FFstrbuf* buffer, char* headerEnd);
|
|
#endif
|