summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.github/scripts/spacecheck.pl5
-rw-r--r--.github/workflows/label.yml2
-rw-r--r--docs/examples/ephiperfifo.c4
-rw-r--r--docs/examples/evhiperfifo.c4
-rw-r--r--docs/examples/hiperfifo.c6
-rw-r--r--lib/CMakeLists.txt8
-rw-r--r--lib/bufq.c1
-rw-r--r--lib/curl_sha512_256.c1
-rw-r--r--lib/ftp.c1
-rw-r--r--lib/http.c2
-rw-r--r--lib/mime.c1
-rw-r--r--lib/rtsp.c154
-rw-r--r--lib/ws.c2
-rw-r--r--packages/OS400/README.OS4002
-rwxr-xr-xscripts/top-complexity4
-rw-r--r--tests/libtest/lib557.c1
-rw-r--r--tests/runner.pm1
-rw-r--r--tests/servers.pm2
-rw-r--r--winbuild/MakefileBuild.vc1
19 files changed, 95 insertions, 107 deletions
diff --git a/.github/scripts/spacecheck.pl b/.github/scripts/spacecheck.pl
index b395ee35e..e61d30b5b 100755
--- a/.github/scripts/spacecheck.pl
+++ b/.github/scripts/spacecheck.pl
@@ -151,6 +151,11 @@ while(my $filename = <$git_ls_files>) {
push @err, "content: has multiple EOL at EOF";
}
+ if($content =~ /\n\n\n\n/ ||
+ $content =~ /\r\n\r\n\r\n\r\n/) {
+ push @err, "content: has 3 or more consecutive empty lines";
+ }
+
if($content =~ /([\x00-\x08\x0b\x0c\x0e-\x1f\x7f])/) {
push @err, "content: has binary contents";
}
diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml
index 53880ae3c..b84702a8a 100644
--- a/.github/workflows/label.yml
+++ b/.github/workflows/label.yml
@@ -23,6 +23,6 @@ jobs:
pull-requests: write
steps:
- - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5
+ - uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b # v6
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
diff --git a/docs/examples/ephiperfifo.c b/docs/examples/ephiperfifo.c
index f411d2ea6..d30b944bb 100644
--- a/docs/examples/ephiperfifo.c
+++ b/docs/examples/ephiperfifo.c
@@ -245,7 +245,6 @@ static void timer_cb(struct GlobalInfo *g, int revents)
}
-
/* Clean up the SockInfo structure */
static void remsock(struct SockInfo *f, struct GlobalInfo *g)
{
@@ -260,7 +259,6 @@ static void remsock(struct SockInfo *f, struct GlobalInfo *g)
}
-
/* Assign information to a SockInfo structure */
static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
struct GlobalInfo *g)
@@ -287,7 +285,6 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
}
-
/* Initialize a new SockInfo structure */
static void addsock(curl_socket_t s, CURL *easy, int action,
struct GlobalInfo *g)
@@ -328,7 +325,6 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
}
-
/* CURLOPT_WRITEFUNCTION */
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
{
diff --git a/docs/examples/evhiperfifo.c b/docs/examples/evhiperfifo.c
index 96937fc62..b28f057c8 100644
--- a/docs/examples/evhiperfifo.c
+++ b/docs/examples/evhiperfifo.c
@@ -165,7 +165,6 @@ static void mcode_or_die(const char *where, CURLMcode code)
}
-
/* Check for completed transfers, and remove their easy handles */
static void check_multi_info(struct GlobalInfo *g)
{
@@ -193,7 +192,6 @@ static void check_multi_info(struct GlobalInfo *g)
}
-
/* Called by libevent when we get action on a multi socket */
static void event_cb(EV_P_ struct ev_io *w, int revents)
{
@@ -243,7 +241,6 @@ static void remsock(struct SockInfo *f, struct GlobalInfo *g)
}
-
/* Assign information to a SockInfo structure */
static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
struct GlobalInfo *g)
@@ -265,7 +262,6 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
}
-
/* Initialize a new SockInfo structure */
static void addsock(curl_socket_t s, CURL *easy, int action,
struct GlobalInfo *g)
diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c
index d1e534ffb..35a519b63 100644
--- a/docs/examples/hiperfifo.c
+++ b/docs/examples/hiperfifo.c
@@ -188,7 +188,6 @@ static void check_multi_info(struct GlobalInfo *g)
}
-
/* Called by libevent when we get action on a multi socket */
static void event_cb(int fd, short kind, void *userp)
{
@@ -212,7 +211,6 @@ static void event_cb(int fd, short kind, void *userp)
}
-
/* Called by libevent when our timeout expires */
static void timer_cb(int fd, short kind, void *userp)
{
@@ -228,7 +226,6 @@ static void timer_cb(int fd, short kind, void *userp)
}
-
/* Clean up the SockInfo structure */
static void remsock(struct SockInfo *f)
{
@@ -241,7 +238,6 @@ static void remsock(struct SockInfo *f)
}
-
/* Assign information to a SockInfo structure */
static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
struct GlobalInfo *g)
@@ -261,7 +257,6 @@ static void setsock(struct SockInfo *f, curl_socket_t s, CURL *e, int act,
}
-
/* Initialize a new SockInfo structure */
static void addsock(curl_socket_t s, CURL *easy, int action,
struct GlobalInfo *g)
@@ -302,7 +297,6 @@ static int sock_cb(CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
}
-
/* CURLOPT_WRITEFUNCTION */
static size_t write_cb(void *ptr, size_t size, size_t nmemb, void *data)
{
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 5d49cfa53..3476d55b0 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -155,11 +155,11 @@ if(BUILD_STATIC_LIBS)
endif()
if(CURL_HAS_LTO)
if(CMAKE_CONFIGURATION_TYPES)
- set_target_properties(${LIB_OBJECT} PROPERTIES
+ set_target_properties(${LIB_STATIC} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
else()
- set_target_properties(${LIB_OBJECT} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
+ set_target_properties(${LIB_STATIC} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()
@@ -191,11 +191,11 @@ if(BUILD_SHARED_LIBS)
endif()
if(CURL_HAS_LTO)
if(CMAKE_CONFIGURATION_TYPES)
- set_target_properties(${LIB_OBJECT} PROPERTIES
+ set_target_properties(${LIB_SHARED} PROPERTIES
INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
else()
- set_target_properties(${LIB_OBJECT} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
+ set_target_properties(${LIB_SHARED} PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
endif()
endif()
diff --git a/lib/bufq.c b/lib/bufq.c
index 40d1af0c1..5cfd7520f 100644
--- a/lib/bufq.c
+++ b/lib/bufq.c
@@ -149,7 +149,6 @@ static void chunk_list_free(struct buf_chunk **anchor)
}
-
void Curl_bufcp_init(struct bufc_pool *pool,
size_t chunk_size, size_t spare_max)
{
diff --git a/lib/curl_sha512_256.c b/lib/curl_sha512_256.c
index e11b2d6a9..7e9b22338 100644
--- a/lib/curl_sha512_256.c
+++ b/lib/curl_sha512_256.c
@@ -665,7 +665,6 @@ static CURLcode Curl_sha512_256_update(void *context,
}
-
/**
* Size of "length" insertion in bits.
* See FIPS PUB 180-4 section 5.1.2.
diff --git a/lib/ftp.c b/lib/ftp.c
index 6d7c210ce..29c2f789a 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -3774,7 +3774,6 @@ static CURLcode ftp_do_more(struct Curl_easy *data, int *completep)
}
-
/***********************************************************************
*
* ftp_perform()
diff --git a/lib/http.c b/lib/http.c
index 67f88736e..e01de6f47 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -2657,7 +2657,7 @@ static CURLcode http_add_connection_hd(struct Curl_easy *data,
if(!result && data->state.http_hd_h2_settings) {
result = curlx_dyn_addf(req, "%s%s", sep, "HTTP2-Settings");
}
- if(rlen < curlx_dyn_len(req))
+ if(!result && (rlen < curlx_dyn_len(req)))
result = curlx_dyn_addn(req, STRCONST("\r\n"));
free(custom_val);
diff --git a/lib/mime.c b/lib/mime.c
index adce92295..894413be1 100644
--- a/lib/mime.c
+++ b/lib/mime.c
@@ -129,7 +129,6 @@ static const char aschex[] =
"\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x41\x42\x43\x44\x45\x46";
-
#ifndef __VMS
#define filesize(name, stat_data) (stat_data.st_size)
#define fopen_read fopen
diff --git a/lib/rtsp.c b/lib/rtsp.c
index dbe3e63cf..1d5f44f91 100644
--- a/lib/rtsp.c
+++ b/lib/rtsp.c
@@ -278,6 +278,84 @@ static CURLcode rtsp_done(struct Curl_easy *data,
return httpStatus;
}
+
+static CURLcode rtsp_setup_body(struct Curl_easy *data,
+ Curl_RtspReq rtspreq,
+ struct dynbuf *reqp)
+{
+ CURLcode result;
+ if(rtspreq == RTSPREQ_ANNOUNCE ||
+ rtspreq == RTSPREQ_SET_PARAMETER ||
+ rtspreq == RTSPREQ_GET_PARAMETER) {
+ curl_off_t req_clen; /* request content length */
+
+ if(data->state.upload) {
+ req_clen = data->state.infilesize;
+ data->state.httpreq = HTTPREQ_PUT;
+ result = Curl_creader_set_fread(data, req_clen);
+ if(result)
+ return result;
+ }
+ else {
+ if(data->set.postfields) {
+ size_t plen = strlen(data->set.postfields);
+ req_clen = (curl_off_t)plen;
+ result = Curl_creader_set_buf(data, data->set.postfields, plen);
+ }
+ else if(data->state.infilesize >= 0) {
+ req_clen = data->state.infilesize;
+ result = Curl_creader_set_fread(data, req_clen);
+ }
+ else {
+ req_clen = 0;
+ result = Curl_creader_set_null(data);
+ }
+ if(result)
+ return result;
+ }
+
+ if(req_clen > 0) {
+ /* As stated in the http comments, it is probably not wise to
+ * actually set a custom Content-Length in the headers */
+ if(!Curl_checkheaders(data, STRCONST("Content-Length"))) {
+ result = curlx_dyn_addf(reqp, "Content-Length: %" FMT_OFF_T"\r\n",
+ req_clen);
+ if(result)
+ return result;
+ }
+
+ if(rtspreq == RTSPREQ_SET_PARAMETER ||
+ rtspreq == RTSPREQ_GET_PARAMETER) {
+ if(!Curl_checkheaders(data, STRCONST("Content-Type"))) {
+ result = curlx_dyn_addn(reqp,
+ STRCONST("Content-Type: "
+ "text/parameters\r\n"));
+ if(result)
+ return result;
+ }
+ }
+
+ if(rtspreq == RTSPREQ_ANNOUNCE) {
+ if(!Curl_checkheaders(data, STRCONST("Content-Type"))) {
+ result = curlx_dyn_addn(reqp,
+ STRCONST("Content-Type: "
+ "application/sdp\r\n"));
+ if(result)
+ return result;
+ }
+ }
+ }
+ else if(rtspreq == RTSPREQ_GET_PARAMETER) {
+ /* Check for an empty GET_PARAMETER (heartbeat) request */
+ data->state.httpreq = HTTPREQ_HEAD;
+ data->req.no_body = TRUE;
+ }
+ }
+ else
+ result = Curl_creader_set_null(data);
+ return result;
+}
+
static CURLcode rtsp_do(struct Curl_easy *data, bool *done)
{
struct connectdata *conn = data->conn;
@@ -561,79 +639,9 @@ static CURLcode rtsp_do(struct Curl_easy *data, bool *done)
if(result)
goto out;
- if(rtspreq == RTSPREQ_ANNOUNCE ||
- rtspreq == RTSPREQ_SET_PARAMETER ||
- rtspreq == RTSPREQ_GET_PARAMETER) {
- curl_off_t req_clen; /* request content length */
-
- if(data->state.upload) {
- req_clen = data->state.infilesize;
- data->state.httpreq = HTTPREQ_PUT;
- result = Curl_creader_set_fread(data, req_clen);
- if(result)
- goto out;
- }
- else {
- if(data->set.postfields) {
- size_t plen = strlen(data->set.postfields);
- req_clen = (curl_off_t)plen;
- result = Curl_creader_set_buf(data, data->set.postfields, plen);
- }
- else if(data->state.infilesize >= 0) {
- req_clen = data->state.infilesize;
- result = Curl_creader_set_fread(data, req_clen);
- }
- else {
- req_clen = 0;
- result = Curl_creader_set_null(data);
- }
- if(result)
- goto out;
- }
-
- if(req_clen > 0) {
- /* As stated in the http comments, it is probably not wise to
- * actually set a custom Content-Length in the headers */
- if(!Curl_checkheaders(data, STRCONST("Content-Length"))) {
- result =
- curlx_dyn_addf(&req_buffer, "Content-Length: %" FMT_OFF_T"\r\n",
- req_clen);
- if(result)
- goto out;
- }
-
- if(rtspreq == RTSPREQ_SET_PARAMETER ||
- rtspreq == RTSPREQ_GET_PARAMETER) {
- if(!Curl_checkheaders(data, STRCONST("Content-Type"))) {
- result = curlx_dyn_addn(&req_buffer,
- STRCONST("Content-Type: "
- "text/parameters\r\n"));
- if(result)
- goto out;
- }
- }
-
- if(rtspreq == RTSPREQ_ANNOUNCE) {
- if(!Curl_checkheaders(data, STRCONST("Content-Type"))) {
- result = curlx_dyn_addn(&req_buffer,
- STRCONST("Content-Type: "
- "application/sdp\r\n"));
- if(result)
- goto out;
- }
- }
- }
- else if(rtspreq == RTSPREQ_GET_PARAMETER) {
- /* Check for an empty GET_PARAMETER (heartbeat) request */
- data->state.httpreq = HTTPREQ_HEAD;
- data->req.no_body = TRUE;
- }
- }
- else {
- result = Curl_creader_set_null(data);
- if(result)
- goto out;
- }
+ result = rtsp_setup_body(data, rtspreq, &req_buffer);
+ if(result)
+ goto out;
/* Finish the request buffer */
result = curlx_dyn_addn(&req_buffer, STRCONST("\r\n"));
diff --git a/lib/ws.c b/lib/ws.c
index 6070cd6d0..229539c3f 100644
--- a/lib/ws.c
+++ b/lib/ws.c
@@ -882,7 +882,6 @@ static CURLcode ws_enc_write_payload(struct ws_encoder *enc,
}
-
struct cr_ws_ctx {
struct Curl_creader super;
BIT(read_eos); /* we read an EOS from the next reader */
@@ -1200,6 +1199,7 @@ CURLcode Curl_ws_accept(struct Curl_easy *data,
/* start over with sending */
data->req.eos_read = FALSE;
+ data->req.upload_done = FALSE;
k->keepon |= KEEP_SEND;
}
diff --git a/packages/OS400/README.OS400 b/packages/OS400/README.OS400
index 41bd24237..e7699e168 100644
--- a/packages/OS400/README.OS400
+++ b/packages/OS400/README.OS400
@@ -256,7 +256,6 @@ _ TELNET
_ TFTP
-
Compiling on OS/400:
These instructions targets people who knows about OS/400, compiling, IFS and
@@ -328,7 +327,6 @@ _ Do not use original source include files unless you know what you are doing.
/curl/include/curl).
-
ILE/RPG support:
Since most of the ILE OS/400 programmers use ILE/RPG exclusively, a
diff --git a/scripts/top-complexity b/scripts/top-complexity
index 764351127..414adaf56 100755
--- a/scripts/top-complexity
+++ b/scripts/top-complexity
@@ -79,10 +79,10 @@ my %whitelist = (
);
# functions with complexity above this level causes the function to return error
-my $cutoff = 72;
+my $cutoff = 70;
# functions above this complexity level are shown
-my $show = 60;
+my $show = 57;
my $error = 0;
my %where;
diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c
index dd0e2e7c4..9742272a4 100644
--- a/tests/libtest/lib557.c
+++ b/tests/libtest/lib557.c
@@ -1222,7 +1222,6 @@ static int test_width_precision(void)
}
-
static int test_weird_arguments(void)
{
int errors = 0;
diff --git a/tests/runner.pm b/tests/runner.pm
index 6fe327a6b..62f722f31 100644
--- a/tests/runner.pm
+++ b/tests/runner.pm
@@ -1140,7 +1140,6 @@ sub singletest_postcheck {
}
-
###################################################################
# Get ready to run a single test case
sub runner_test_preprocess {
diff --git a/tests/servers.pm b/tests/servers.pm
index 41b7ae41c..e62505887 100644
--- a/tests/servers.pm
+++ b/tests/servers.pm
@@ -2244,8 +2244,6 @@ sub runnegtelnetserver {
}
-
-
#######################################################################
# Single shot http and gopher server responsiveness test. This should only
# be used to verify that a server present in %run hash is still functional
diff --git a/winbuild/MakefileBuild.vc b/winbuild/MakefileBuild.vc
index 8d1dd2888..509e43e26 100644
--- a/winbuild/MakefileBuild.vc
+++ b/winbuild/MakefileBuild.vc
@@ -422,7 +422,6 @@ CFGSET = true
!ENDIF
-
# CURL_XX macros are for the curl.exe command
!IF "$(DEBUG)"=="yes"