commit 93b36d5f1282733b462106bd3cf1097fa00a322d
parent dcf3eef818ee6a065ac780ab894cd6b3c0cf58c8
Author: Erik Agsjö <erik.agsjo@gmail.com>
Date: Mon, 31 Jul 2023 15:46:31 +0200
Formatting + warnings
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/naett_win.c b/src/naett_win.c
@@ -88,11 +88,8 @@ static void unpackHeaders(InternalResponse* res, LPWSTR packed) {
res->headers = firstHeader;
}
-static void CALLBACK callback(HINTERNET request,
- DWORD_PTR context,
- DWORD status,
- LPVOID statusInformation,
- DWORD statusInfoLength) {
+static void CALLBACK
+callback(HINTERNET request, DWORD_PTR context, DWORD status, LPVOID statusInformation, DWORD statusInfoLength) {
InternalResponse* res = (InternalResponse*)context;
switch (status) {
@@ -114,7 +111,7 @@ static void CALLBACK callback(HINTERNET request,
unpackHeaders(res, buffer);
free(buffer);
- const char *contentLength = naettGetHeader((naettRes *)res, "Content-Length");
+ const char* contentLength = naettGetHeader((naettRes*)res, "Content-Length");
if (!contentLength || sscanf(contentLength, "%d", &res->contentLength) != 1) {
res->contentLength = -1;
}
@@ -238,8 +235,11 @@ int naettPlatformInitRequest(InternalRequest* req) {
if (req->options.userAgent) {
uaBuf = winFromUTF8(req->options.userAgent);
}
- req->session = WinHttpOpen(
- uaBuf ? uaBuf : _T(NAETT_UA), WINHTTP_ACCESS_TYPE_NO_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, WINHTTP_FLAG_ASYNC);
+ req->session = WinHttpOpen(uaBuf ? (LPCWSTR)uaBuf : _T(NAETT_UA),
+ WINHTTP_ACCESS_TYPE_NO_PROXY,
+ WINHTTP_NO_PROXY_NAME,
+ WINHTTP_NO_PROXY_BYPASS,
+ WINHTTP_FLAG_ASYNC);
free(uaBuf);
if (!req->session) {