/* The first four bytes is an unsigned int indicating number
of bytes of data in the rest of the buffer. */
- extension_len = (unsigned int *)(void *)(&alpn_buffer[cur]);
+ extension_len = (unsigned int *)(void *)&alpn_buffer[cur];
cur += (int)sizeof(unsigned int);
/* The next four bytes are an indicator that this buffer contains
/* The next two bytes is an unsigned short indicating the number
of bytes used to list the preferred protocols. */
- list_len = (unsigned short *)(void *)(&alpn_buffer[cur]);
+ list_len = (unsigned short *)(void *)&alpn_buffer[cur];
cur += (int)sizeof(unsigned short);
list_start_index = cur;
#include <curl/curl.h>
#include "config-os400.h" /* Not curl_setup.h: we only need some defines. */
-#include <sys/types.h>
-#include <sys/socket.h>
#include <sys/un.h>
#include <stdlib.h>
# or destroys the connection with internal error
# ERR_QPACK_HEADER_TOO_LARGE,
# depending on nghttp3 version and payload size
- assert r.exit_code in (0, 56), f'expected exit code 0 or 56, '\
+ assert r.exit_code in [0, 56], f'expected exit code 0 or 56, '\
f'got {r.exit_code}\n{r.dump_logs()}'
if r.exit_code == 0:
r.check_response(http_status=431)
'--connect-timeout', '1'
])
# should fail with CURLE_OPERATION_TIMEOUT or COULDNT_CONNECT
- assert r.exit_code in (7, 28), f'{r.dump_logs()}'
+ assert r.exit_code in [7, 28], f'{r.dump_logs()}'
af_unspec_resolves = [
line for line in r.trace_lines
if re.match(r'.* \[DNS] re-queueing query .+ for AF_UNSPEC resolve', line)
result = curl_easy_getinfo(curl, CURLINFO_COOKIELIST, &cookies);
if(!result && cookies) {
/* a linked list of cookies in cookie file format */
- struct curl_slist *each = cookies;
+ const struct curl_slist *each = cookies;
while(each) {
curl_mprintf("%s\n", each->data);
each = each->next;
easy_setopt(curl, CURLOPT_HEADER, 1L);
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
easy_setopt(curl, CURLOPT_URL, URL);
- easy_setopt(curl, CURLOPT_HTTPAUTH, (long)CURLAUTH_NEGOTIATE);
+ easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_NEGOTIATE);
easy_setopt(curl, CURLOPT_USERPWD, ":");
easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
/* Enumerate each certificate in the chain */
for(cert = 0; cert < cert_info->num_of_certs; cert++) {
- struct curl_slist *slist = cert_info->certinfo[cert];
+ const struct curl_slist *slist = cert_info->certinfo[cert];
const char *issuer = NULL;
const char *subject = NULL;
result = ctx[i].result;
}
else {
- struct curl_slist *item = ctx[i].contents;
+ const struct curl_slist *item = ctx[i].contents;
while(item) {
curl_mprintf("%s", item->data);
item = item->next;
}
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
- easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, (long)CURLHTTPSIG_ED25519);
+ easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, CURLHTTPSIG_ED25519);
easy_setopt(curl, CURLOPT_HTTPSIG_KEY,
"9f8362f87a484a954e6e740c5b4c0e84"
"229139a20aa8ab56ff66586f6a7d29c5");
}
easy_setopt(curl, CURLOPT_VERBOSE, 1L);
- easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, (long)CURLHTTPSIG_ED25519);
+ easy_setopt(curl, CURLOPT_HTTPSIG_ALGORITHM, CURLHTTPSIG_ED25519);
easy_setopt(curl, CURLOPT_HTTPSIG_KEY,
"9f8362f87a484a954e6e740c5b4c0e84"
"229139a20aa8ab56ff66586f6a7d29c5");
formrc = curl_formadd(&formpost,
&lastptr,
CURLFORM_PTRNAME, testname,
- CURLFORM_NAMELENGTH, (long)(sizeof(testname) - 2),
+ CURLFORM_NAMELENGTH, (long)CURL_CSTRLEN(testname) - 1,
CURLFORM_ARRAY, formarray,
CURLFORM_FILENAME, "remotefile.txt",
CURLFORM_END);