http: remove "struct HTTP"
It is not actually used anymore and only contained a dummy struct field. Remove all traces and uses of it. Closes #13927
This commit is contained in:
parent
69b6c10568
commit
7208ff6534
@ -65,7 +65,6 @@ typedef enum {
|
|||||||
|
|
||||||
/* struct for HTTP CONNECT tunneling */
|
/* struct for HTTP CONNECT tunneling */
|
||||||
struct h1_tunnel_state {
|
struct h1_tunnel_state {
|
||||||
struct HTTP CONNECT;
|
|
||||||
struct dynbuf rcvbuf;
|
struct dynbuf rcvbuf;
|
||||||
struct dynbuf request_data;
|
struct dynbuf request_data;
|
||||||
size_t nsent;
|
size_t nsent;
|
||||||
|
|||||||
12
lib/http.c
12
lib/http.c
@ -169,14 +169,6 @@ CURLcode Curl_http_setup_conn(struct Curl_easy *data,
|
|||||||
{
|
{
|
||||||
/* allocate the HTTP-specific struct for the Curl_easy, only to survive
|
/* allocate the HTTP-specific struct for the Curl_easy, only to survive
|
||||||
during this request */
|
during this request */
|
||||||
struct HTTP *http;
|
|
||||||
DEBUGASSERT(data->req.p.http == NULL);
|
|
||||||
|
|
||||||
http = calloc(1, sizeof(struct HTTP));
|
|
||||||
if(!http)
|
|
||||||
return CURLE_OUT_OF_MEMORY;
|
|
||||||
|
|
||||||
data->req.p.http = http;
|
|
||||||
connkeep(conn, "HTTP default");
|
connkeep(conn, "HTTP default");
|
||||||
|
|
||||||
if(data->state.httpwant == CURL_HTTP_VERSION_3ONLY) {
|
if(data->state.httpwant == CURL_HTTP_VERSION_3ONLY) {
|
||||||
@ -1174,16 +1166,12 @@ CURLcode Curl_http_done(struct Curl_easy *data,
|
|||||||
CURLcode status, bool premature)
|
CURLcode status, bool premature)
|
||||||
{
|
{
|
||||||
struct connectdata *conn = data->conn;
|
struct connectdata *conn = data->conn;
|
||||||
struct HTTP *http = data->req.p.http;
|
|
||||||
|
|
||||||
/* Clear multipass flag. If authentication isn't done yet, then it will get
|
/* Clear multipass flag. If authentication isn't done yet, then it will get
|
||||||
* a chance to be set back to true when we output the next auth header */
|
* a chance to be set back to true when we output the next auth header */
|
||||||
data->state.authhost.multipass = FALSE;
|
data->state.authhost.multipass = FALSE;
|
||||||
data->state.authproxy.multipass = FALSE;
|
data->state.authproxy.multipass = FALSE;
|
||||||
|
|
||||||
if(!http)
|
|
||||||
return CURLE_OK;
|
|
||||||
|
|
||||||
Curl_dyn_reset(&data->state.headerb);
|
Curl_dyn_reset(&data->state.headerb);
|
||||||
Curl_hyper_done(data);
|
Curl_hyper_done(data);
|
||||||
|
|
||||||
|
|||||||
@ -73,7 +73,6 @@ char *Curl_checkProxyheaders(struct Curl_easy *data,
|
|||||||
const struct connectdata *conn,
|
const struct connectdata *conn,
|
||||||
const char *thisheader,
|
const char *thisheader,
|
||||||
const size_t thislen);
|
const size_t thislen);
|
||||||
struct HTTP; /* see below */
|
|
||||||
|
|
||||||
CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
CURLcode Curl_add_timecondition(struct Curl_easy *data,
|
||||||
#ifndef USE_HYPER
|
#ifndef USE_HYPER
|
||||||
@ -187,10 +186,6 @@ void Curl_http_exp100_got100(struct Curl_easy *data);
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* HTTP unique setup
|
* HTTP unique setup
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
struct HTTP {
|
|
||||||
/* TODO: no longer used, we should remove it from SingleRequest */
|
|
||||||
char unused;
|
|
||||||
};
|
|
||||||
|
|
||||||
CURLcode Curl_http_size(struct Curl_easy *data);
|
CURLcode Curl_http_size(struct Curl_easy *data);
|
||||||
|
|
||||||
|
|||||||
15
lib/http2.c
15
lib/http2.c
@ -292,10 +292,6 @@ static CURLcode http2_data_setup(struct Curl_cfilter *cf,
|
|||||||
|
|
||||||
(void)cf;
|
(void)cf;
|
||||||
DEBUGASSERT(data);
|
DEBUGASSERT(data);
|
||||||
if(!data->req.p.http) {
|
|
||||||
failf(data, "initialization failure, transfer not http initialized");
|
|
||||||
return CURLE_FAILED_INIT;
|
|
||||||
}
|
|
||||||
stream = H2_STREAM_CTX(ctx, data);
|
stream = H2_STREAM_CTX(ctx, data);
|
||||||
if(stream) {
|
if(stream) {
|
||||||
*pstream = stream;
|
*pstream = stream;
|
||||||
@ -797,19 +793,10 @@ static struct Curl_easy *h2_duphandle(struct Curl_cfilter *cf,
|
|||||||
{
|
{
|
||||||
struct Curl_easy *second = curl_easy_duphandle(data);
|
struct Curl_easy *second = curl_easy_duphandle(data);
|
||||||
if(second) {
|
if(second) {
|
||||||
/* setup the request struct */
|
|
||||||
struct HTTP *http = calloc(1, sizeof(struct HTTP));
|
|
||||||
if(!http) {
|
|
||||||
(void)Curl_close(&second);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
struct h2_stream_ctx *second_stream;
|
struct h2_stream_ctx *second_stream;
|
||||||
|
|
||||||
second->req.p.http = http;
|
|
||||||
http2_data_setup(cf, second, &second_stream);
|
http2_data_setup(cf, second, &second_stream);
|
||||||
second->state.priority.weight = data->state.priority.weight;
|
second->state.priority.weight = data->state.priority.weight;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return second;
|
return second;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -870,9 +857,7 @@ fail:
|
|||||||
static void discard_newhandle(struct Curl_cfilter *cf,
|
static void discard_newhandle(struct Curl_cfilter *cf,
|
||||||
struct Curl_easy *newhandle)
|
struct Curl_easy *newhandle)
|
||||||
{
|
{
|
||||||
if(newhandle->req.p.http) {
|
|
||||||
http2_data_done(cf, newhandle);
|
http2_data_done(cf, newhandle);
|
||||||
}
|
|
||||||
(void)Curl_close(&newhandle);
|
(void)Curl_close(&newhandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,7 +109,7 @@ void Curl_req_hard_reset(struct SingleRequest *req, struct Curl_easy *data)
|
|||||||
|
|
||||||
/* This is a bit ugly. `req->p` is a union and we assume we can
|
/* This is a bit ugly. `req->p` is a union and we assume we can
|
||||||
* free this safely without leaks. */
|
* free this safely without leaks. */
|
||||||
Curl_safefree(req->p.http);
|
Curl_safefree(req->p.ftp);
|
||||||
Curl_safefree(req->newurl);
|
Curl_safefree(req->newurl);
|
||||||
Curl_client_reset(data);
|
Curl_client_reset(data);
|
||||||
if(req->sendbuf_init)
|
if(req->sendbuf_init)
|
||||||
@ -164,7 +164,7 @@ void Curl_req_free(struct SingleRequest *req, struct Curl_easy *data)
|
|||||||
{
|
{
|
||||||
/* This is a bit ugly. `req->p` is a union and we assume we can
|
/* This is a bit ugly. `req->p` is a union and we assume we can
|
||||||
* free this safely without leaks. */
|
* free this safely without leaks. */
|
||||||
Curl_safefree(req->p.http);
|
Curl_safefree(req->p.ftp);
|
||||||
Curl_safefree(req->newurl);
|
Curl_safefree(req->newurl);
|
||||||
if(req->sendbuf_init)
|
if(req->sendbuf_init)
|
||||||
Curl_bufq_free(&req->sendbuf);
|
Curl_bufq_free(&req->sendbuf);
|
||||||
|
|||||||
@ -104,7 +104,6 @@ struct SingleRequest {
|
|||||||
union {
|
union {
|
||||||
struct FILEPROTO *file;
|
struct FILEPROTO *file;
|
||||||
struct FTP *ftp;
|
struct FTP *ftp;
|
||||||
struct HTTP *http;
|
|
||||||
struct IMAP *imap;
|
struct IMAP *imap;
|
||||||
struct ldapreqinfo *ldap;
|
struct ldapreqinfo *ldap;
|
||||||
struct MQTT *mqtt;
|
struct MQTT *mqtt;
|
||||||
|
|||||||
10
lib/rtsp.h
10
lib/rtsp.h
@ -62,16 +62,6 @@ struct rtsp_conn {
|
|||||||
* RTSP unique setup
|
* RTSP unique setup
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
struct RTSP {
|
struct RTSP {
|
||||||
/*
|
|
||||||
* http_wrapper MUST be the first element of this structure for the wrap
|
|
||||||
* logic to work. In this way, we get a cheap polymorphism because
|
|
||||||
* &(data->state.proto.rtsp) == &(data->state.proto.http) per the C spec
|
|
||||||
*
|
|
||||||
* HTTP functions can safely treat this as an HTTP struct, but RTSP aware
|
|
||||||
* functions can also index into the later elements.
|
|
||||||
*/
|
|
||||||
struct HTTP http_wrapper; /* wrap HTTP to do the heavy lifting */
|
|
||||||
|
|
||||||
long CSeq_sent; /* CSeq of this request */
|
long CSeq_sent; /* CSeq of this request */
|
||||||
long CSeq_recv; /* CSeq received */
|
long CSeq_recv; /* CSeq received */
|
||||||
};
|
};
|
||||||
|
|||||||
@ -198,7 +198,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf,
|
|||||||
struct cf_ngtcp2_ctx *ctx = cf->ctx;
|
struct cf_ngtcp2_ctx *ctx = cf->ctx;
|
||||||
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
|
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
|
||||||
|
|
||||||
if(!data || !data->req.p.http) {
|
if(!data) {
|
||||||
failf(data, "initialization failure, transfer not http initialized");
|
failf(data, "initialization failure, transfer not http initialized");
|
||||||
return CURLE_FAILED_INIT;
|
return CURLE_FAILED_INIT;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -521,7 +521,7 @@ static CURLcode h3_data_setup(struct Curl_cfilter *cf,
|
|||||||
struct cf_osslq_ctx *ctx = cf->ctx;
|
struct cf_osslq_ctx *ctx = cf->ctx;
|
||||||
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
|
struct h3_stream_ctx *stream = H3_STREAM_CTX(ctx, data);
|
||||||
|
|
||||||
if(!data || !data->req.p.http) {
|
if(!data) {
|
||||||
failf(data, "initialization failure, transfer not http initialized");
|
failf(data, "initialization failure, transfer not http initialized");
|
||||||
return CURLE_FAILED_INIT;
|
return CURLE_FAILED_INIT;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user