http_proxy: make CONNECT work with the Hyper backend

Makes test 80 run

Closes #6406
This commit is contained in:
Daniel Stenberg 2021-01-04 09:36:41 +01:00
parent e269785cf1
commit bcce220367
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 284 additions and 49 deletions

View file

@ -57,8 +57,8 @@
#include "curl_memory.h"
#include "memdebug.h"
static size_t read_cb(void *userp, hyper_context *ctx,
uint8_t *buf, size_t buflen)
size_t Curl_hyper_recv(void *userp, hyper_context *ctx,
uint8_t *buf, size_t buflen)
{
struct connectdata *conn = (struct connectdata *)userp;
struct Curl_easy *data = conn->data;
@ -86,7 +86,7 @@ static size_t read_cb(void *userp, hyper_context *ctx,
return (size_t)nread;
}
static size_t write_cb(void *userp, hyper_context *ctx,
size_t Curl_hyper_send(void *userp, hyper_context *ctx,
const uint8_t *buf, size_t buflen)
{
struct connectdata *conn = (struct connectdata *)userp;
@ -256,11 +256,11 @@ static CURLcode empty_header(struct Curl_easy *data)
CURLE_WRITE_ERROR : CURLE_OK;
}
static CURLcode hyperstream(struct Curl_easy *data,
struct connectdata *conn,
int *didwhat,
bool *done,
int select_res)
CURLcode Curl_hyper_stream(struct Curl_easy *data,
struct connectdata *conn,
int *didwhat,
bool *done,
int select_res)
{
hyper_response *resp = NULL;
uint16_t http_status;
@ -692,8 +692,8 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
}
/* tell Hyper how to read/write network data */
hyper_io_set_userdata(io, conn);
hyper_io_set_read(io, read_cb);
hyper_io_set_write(io, write_cb);
hyper_io_set_read(io, Curl_hyper_recv);
hyper_io_set_write(io, Curl_hyper_send);
/* create an executor to poll futures */
if(!h->exec) {
@ -868,7 +868,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
Curl_pgrsSetUploadSize(data, 0); /* nothing */
Curl_setup_transfer(data, FIRSTSOCKET, -1, TRUE, -1);
}
conn->datastream = hyperstream;
conn->datastream = Curl_hyper_stream;
return CURLE_OK;
error: