]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
hyper: remove the conn->data references
authorDaniel Stenberg <daniel@haxx.se>
Thu, 21 Jan 2021 15:49:14 +0000 (16:49 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 22 Jan 2021 15:07:17 +0000 (16:07 +0100)
Closes #6508

lib/c-hyper.c

index 7c735da71f5dca5f4141759fa43dc2df784f86ec..b92812bd645642a7ad6e6eaf04c29f2c4a6afd01 100644 (file)
@@ -60,8 +60,8 @@
 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;
+  struct Curl_easy *data = userp;
+  struct connectdata *conn = data->conn;
   CURLcode result;
   ssize_t nread;
 
@@ -89,8 +89,8 @@ size_t Curl_hyper_recv(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;
-  struct Curl_easy *data = conn->data;
+  struct Curl_easy *data = userp;
+  struct connectdata *conn = data->conn;
   CURLcode result;
   ssize_t nwrote;
 
@@ -686,7 +686,7 @@ CURLcode Curl_http(struct Curl_easy *data, bool *done)
     goto error;
   }
   /* tell Hyper how to read/write network data */
-  hyper_io_set_userdata(io, conn);
+  hyper_io_set_userdata(io, data);
   hyper_io_set_read(io, Curl_hyper_recv);
   hyper_io_set_write(io, Curl_hyper_send);