Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions docs/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ unpacked the source archive):

(Adjust the configure line accordingly to use the TLS library you want.)

By default curl builds with libpsl (Public Suffix List) support. If libpsl is
not available on your system, install it or disable it with `--without-libpsl`.

You probably need to be root when doing the last command.

Get a full listing of all available configure options by invoking it like:
Expand All @@ -65,10 +68,9 @@ your own home directory:
make
make install

The configure script always tries to find a working SSL library unless
explicitly told not to. If you have OpenSSL installed in the default search
path for your compiler/linker, you do not need to do anything special. If you
have OpenSSL installed in `/usr/local/ssl`, you can run configure like:
The configure script requires you to select a TLS backend explicitly unless
you disable TLS with `--without-ssl`. If you have OpenSSL installed in the
default search path for your compiler/linker, you can run configure like:

./configure --with-openssl

Expand All @@ -91,7 +93,7 @@ header files somewhere else, you have to set the `LDFLAGS` and `CPPFLAGS`
environment variables prior to running configure. Something like this should
work:

CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" ./configure
CPPFLAGS="-I/path/to/ssl/include" LDFLAGS="-L/path/to/ssl/lib" ./configure --with-openssl

If you have shared SSL libs installed in a directory where your runtime
linker does not find them (which usually causes configure failures), you can
Expand Down
4 changes: 2 additions & 2 deletions lib/cf-h1-proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ static CURLcode tunnel_init(struct Curl_cfilter *cf,
{
struct h1_tunnel_state *ts;

if(cf->conn->handler->flags & PROTOPT_NOTCPPROXY) {
failf(data, "%s cannot be done over CONNECT", cf->conn->handler->scheme);
if(cf->conn->scheme->flags & PROTOPT_NOTCPPROXY) {
failf(data, "%s cannot be done over CONNECT", cf->conn->scheme->name);
return CURLE_UNSUPPORTED_PROTOCOL;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/cf-ip-happy.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ static CURLcode cf_ip_happy_connect(struct Curl_cfilter *cf,
cf_ip_happy_ctx_clear(cf, data);
Curl_expire_done(data, EXPIRE_HAPPY_EYEBALLS);

if(cf->conn->handler->protocol & PROTO_FAMILY_SSH)
if(cf->conn->scheme->protocol & PROTO_FAMILY_SSH)
Curl_pgrsTime(data, TIMER_APPCONNECT); /* we are connected already */
#ifndef CURL_DISABLE_VERBOSE_STRINGS
if(Curl_trc_cf_is_verbose(cf, data)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/cf-socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ static void set_local_ip(struct Curl_cfilter *cf,

#ifdef HAVE_GETSOCKNAME
if((ctx->sock != CURL_SOCKET_BAD) &&
!(data->conn->handler->protocol & CURLPROTO_TFTP)) {
!(data->conn->scheme->protocol & CURLPROTO_TFTP)) {
/* TFTP does not connect, so it cannot get the IP like this */

char buffer[STRERROR_LEN];
Expand Down
2 changes: 1 addition & 1 deletion lib/cfilters.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ bool Curl_conn_is_connected(struct connectdata *conn, int sockindex)
cf = conn->cfilter[sockindex];
if(cf)
return (bool)cf->connected;
else if(conn->handler->flags & PROTOPT_NONETWORK)
else if(conn->scheme->flags & PROTOPT_NONETWORK)
return TRUE;
return FALSE;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ static CURLcode cf_setup_connect(struct Curl_cfilter *cf,
#ifdef USE_SSL
if((ctx->ssl_mode == CURL_CF_SSL_ENABLE ||
(ctx->ssl_mode != CURL_CF_SSL_DISABLE &&
cf->conn->handler->flags & PROTOPT_SSL)) /* we want SSL */
cf->conn->scheme->flags & PROTOPT_SSL)) /* we want SSL */
&& !Curl_conn_is_ssl(cf->conn, cf->sockindex)) { /* it is missing */
result = Curl_cf_ssl_insert_after(cf, data);
if(result)
Expand Down Expand Up @@ -563,15 +563,15 @@ CURLcode Curl_conn_setup(struct Curl_easy *data,
CURLcode result = CURLE_OK;

DEBUGASSERT(data);
DEBUGASSERT(conn->handler);
DEBUGASSERT(conn->scheme);
DEBUGASSERT(dns);

Curl_resolv_unlink(data, &data->state.dns[sockindex]);
data->state.dns[sockindex] = dns;

#ifndef CURL_DISABLE_HTTP
if(!conn->cfilter[sockindex] &&
conn->handler->protocol == CURLPROTO_HTTPS) {
conn->scheme->protocol == CURLPROTO_HTTPS) {
DEBUGASSERT(ssl_mode != CURL_CF_SSL_DISABLE);
result = Curl_cf_https_setup(data, conn, sockindex);
if(result)
Expand Down
2 changes: 1 addition & 1 deletion lib/cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -1234,7 +1234,7 @@ static int cookie_sort_ct(const void *p1, const void *p2)

bool Curl_secure_context(struct connectdata *conn, const char *host)
{
return conn->handler->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS) ||
return conn->scheme->protocol & (CURLPROTO_HTTPS | CURLPROTO_WSS) ||
curl_strequal("localhost", host) ||
!strcmp(host, "127.0.0.1") ||
!strcmp(host, "::1");
Expand Down
4 changes: 2 additions & 2 deletions lib/cshutdn.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void cshutdn_run_conn_handler(struct Curl_easy *data,
{
if(!conn->bits.shutdown_handler) {

if(conn->handler && conn->handler->disconnect) {
if(conn->scheme && conn->scheme->run->disconnect) {
/* Some disconnect handlers do a blocking wait on server responses.
* FTP/IMAP/SMTP and SFTP are among them. When using the internal
* handle, set an overall short timeout so we do not hang for the
Expand All @@ -59,7 +59,7 @@ static void cshutdn_run_conn_handler(struct Curl_easy *data,
conn->connection_id, conn->bits.aborted));
/* There are protocol handlers that block on retrieving
* server responses here (FTP). Set a short timeout. */
conn->handler->disconnect(data, conn, (bool)conn->bits.aborted);
conn->scheme->run->disconnect(data, conn, (bool)conn->bits.aborted);
}

conn->bits.shutdown_handler = TRUE;
Expand Down
12 changes: 4 additions & 8 deletions lib/curl_ldap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,11 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#ifndef CURL_DISABLE_LDAP
extern const struct Curl_handler Curl_handler_ldap;
extern const struct Curl_protocol Curl_protocol_ldap;

#if !defined(CURL_DISABLE_LDAPS) && \
((defined(USE_OPENLDAP) && defined(USE_SSL)) || \
(!defined(USE_OPENLDAP) && defined(HAVE_LDAP_SSL)))
extern const struct Curl_handler Curl_handler_ldaps;
#endif
extern const struct Curl_scheme Curl_scheme_ldap;
extern const struct Curl_scheme Curl_scheme_ldaps;

void Curl_ldap_version(char *buf, size_t bufsz);
#endif

#endif /* HEADER_CURL_LDAP_H */
165 changes: 57 additions & 108 deletions lib/curl_rtmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@
***************************************************************************/
#include "curl_setup.h"

#ifdef USE_LIBRTMP

#include "curl_rtmp.h"
#include "urldata.h"

#ifdef USE_LIBRTMP

#include "url.h"
#include "curlx/nonblock.h"
#include "progress.h" /* for Curl_pgrsSetUploadSize */
Expand Down Expand Up @@ -224,8 +225,7 @@ void Curl_rtmp_version(char *version, size_t len)
* RTMP protocol handler.h, based on https://rtmpdump.mplayerhq.hu/
*/

const struct Curl_handler Curl_handler_rtmp = {
"rtmp", /* scheme */
static const struct Curl_protocol Curl_protocol_rtmp = {
rtmp_setup_connection, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
Expand All @@ -243,135 +243,84 @@ const struct Curl_handler Curl_handler_rtmp = {
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
ZERO_NULL, /* follow */
PORT_RTMP, /* defport */
};

#endif /* USE_LIBRTMP */

const struct Curl_scheme Curl_scheme_rtmp = {
"rtmp", /* scheme */
#ifndef USE_LIBRTMP
ZERO_NULL,
#else
&Curl_protocol_rtmp,
#endif
CURLPROTO_RTMP, /* protocol */
CURLPROTO_RTMP, /* family */
PROTOPT_NONE /* flags */
PROTOPT_NONE, /* flags */
PORT_RTMP, /* defport */
};

const struct Curl_handler Curl_handler_rtmpt = {
const struct Curl_scheme Curl_scheme_rtmpt = {
"rtmpt", /* scheme */
rtmp_setup_connection, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_pollset */
ZERO_NULL, /* doing_pollset */
ZERO_NULL, /* domore_pollset */
ZERO_NULL, /* perform_pollset */
rtmp_disconnect, /* disconnect */
ZERO_NULL, /* write_resp */
ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
ZERO_NULL, /* follow */
PORT_RTMPT, /* defport */
#ifndef USE_LIBRTMP
ZERO_NULL,
#else
&Curl_protocol_rtmp,
#endif
CURLPROTO_RTMPT, /* protocol */
CURLPROTO_RTMPT, /* family */
PROTOPT_NONE /* flags */
PROTOPT_NONE, /* flags */
PORT_RTMPT, /* defport */
};

const struct Curl_handler Curl_handler_rtmpe = {
const struct Curl_scheme Curl_scheme_rtmpe = {
"rtmpe", /* scheme */
rtmp_setup_connection, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_pollset */
ZERO_NULL, /* doing_pollset */
ZERO_NULL, /* domore_pollset */
ZERO_NULL, /* perform_pollset */
rtmp_disconnect, /* disconnect */
ZERO_NULL, /* write_resp */
ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
ZERO_NULL, /* follow */
PORT_RTMP, /* defport */
#ifndef USE_LIBRTMP
ZERO_NULL,
#else
&Curl_protocol_rtmp,
#endif
CURLPROTO_RTMPE, /* protocol */
CURLPROTO_RTMPE, /* family */
PROTOPT_NONE /* flags */
PROTOPT_NONE, /* flags */
PORT_RTMP, /* defport */
};

const struct Curl_handler Curl_handler_rtmpte = {
const struct Curl_scheme Curl_scheme_rtmpte = {
"rtmpte", /* scheme */
rtmp_setup_connection, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_pollset */
ZERO_NULL, /* doing_pollset */
ZERO_NULL, /* domore_pollset */
ZERO_NULL, /* perform_pollset */
rtmp_disconnect, /* disconnect */
ZERO_NULL, /* write_resp */
ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
ZERO_NULL, /* follow */
PORT_RTMPT, /* defport */
#ifndef USE_LIBRTMP
ZERO_NULL,
#else
&Curl_protocol_rtmp,
#endif
CURLPROTO_RTMPTE, /* protocol */
CURLPROTO_RTMPTE, /* family */
PROTOPT_NONE /* flags */
PROTOPT_NONE, /* flags */
PORT_RTMPT, /* defport */
};

const struct Curl_handler Curl_handler_rtmps = {
const struct Curl_scheme Curl_scheme_rtmps = {
"rtmps", /* scheme */
rtmp_setup_connection, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_pollset */
ZERO_NULL, /* doing_pollset */
ZERO_NULL, /* domore_pollset */
ZERO_NULL, /* perform_pollset */
rtmp_disconnect, /* disconnect */
ZERO_NULL, /* write_resp */
ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
ZERO_NULL, /* follow */
PORT_RTMPS, /* defport */
#ifndef USE_LIBRTMP
ZERO_NULL,
#else
&Curl_protocol_rtmp,
#endif
CURLPROTO_RTMPS, /* protocol */
CURLPROTO_RTMP, /* family */
PROTOPT_NONE /* flags */
PROTOPT_NONE, /* flags */
PORT_RTMPS, /* defport */
};

const struct Curl_handler Curl_handler_rtmpts = {
const struct Curl_scheme Curl_scheme_rtmpts = {
"rtmpts", /* scheme */
rtmp_setup_connection, /* setup_connection */
rtmp_do, /* do_it */
rtmp_done, /* done */
ZERO_NULL, /* do_more */
rtmp_connect, /* connect_it */
ZERO_NULL, /* connecting */
ZERO_NULL, /* doing */
ZERO_NULL, /* proto_pollset */
ZERO_NULL, /* doing_pollset */
ZERO_NULL, /* domore_pollset */
ZERO_NULL, /* perform_pollset */
rtmp_disconnect, /* disconnect */
ZERO_NULL, /* write_resp */
ZERO_NULL, /* write_resp_hd */
ZERO_NULL, /* connection_check */
ZERO_NULL, /* attach connection */
ZERO_NULL, /* follow */
PORT_RTMPS, /* defport */
#ifndef USE_LIBRTMP
ZERO_NULL,
#else
&Curl_protocol_rtmp,
#endif
CURLPROTO_RTMPTS, /* protocol */
CURLPROTO_RTMPT, /* family */
PROTOPT_NONE /* flags */
PROTOPT_NONE, /* flags */
PORT_RTMPS, /* defport */
};

#endif /* USE_LIBRTMP */
13 changes: 6 additions & 7 deletions lib/curl_rtmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,13 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
extern const struct Curl_scheme Curl_scheme_rtmp;
extern const struct Curl_scheme Curl_scheme_rtmpt;
extern const struct Curl_scheme Curl_scheme_rtmpe;
extern const struct Curl_scheme Curl_scheme_rtmpte;
extern const struct Curl_scheme Curl_scheme_rtmps;
extern const struct Curl_scheme Curl_scheme_rtmpts;
#ifdef USE_LIBRTMP
extern const struct Curl_handler Curl_handler_rtmp;
extern const struct Curl_handler Curl_handler_rtmpt;
extern const struct Curl_handler Curl_handler_rtmpe;
extern const struct Curl_handler Curl_handler_rtmpte;
extern const struct Curl_handler Curl_handler_rtmps;
extern const struct Curl_handler Curl_handler_rtmpts;

void Curl_rtmp_version(char *version, size_t len);
#endif

Expand Down
2 changes: 1 addition & 1 deletion lib/cw-out.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static CURLcode cw_out_cb_write(struct cw_out_ctx *ctx,
blen, (otype == CW_OUT_HDS) ? "header" : "body",
nwritten);
if(CURL_WRITEFUNC_PAUSE == nwritten) {
if(data->conn->handler->flags & PROTOPT_NONETWORK) {
if(data->conn->scheme->flags & PROTOPT_NONETWORK) {
/* Protocols that work without network cannot be paused. This is
actually only FILE:// just now, and it cannot pause since the
transfer is not done using the "normal" procedure. */
Expand Down
Loading