mirror of
https://github.com/curl/curl.git
synced 2026-08-25 14:33:44 +03:00
http_proxy: make CONNECT work with the Hyper backend
Makes test 80 run Closes #6406
This commit is contained in:
parent
e269785cf1
commit
bcce220367
4 changed files with 284 additions and 49 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue