Re: [PATCH] smart-http: Don't use Expect: 100-Continue

Subsystems: the rest

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] smart-http: Don't use Expect: 100-Continue

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:50:34

"Shawn O. Pearce" [off-list ref] writes:
quoted hunk
diff --git a/remote-curl.c b/remote-curl.c
index 04d4813..3d82dc2 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -356,14 +356,59 @@ static size_t rpc_in(const void *ptr, size_t eltsize,
...
+static int probe_rpc(struct rpc_state *rpc)
+{
+...
+	curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
+	curl_easy_setopt(slot->curl, CURLOPT_FILE, buf);
+
+	err = run_slot(slot);
+
+	curl_slist_free_all(headers);
+	strbuf_release(&buf);
+	return err;
+}
Hmm, I am getting

    remote-curl.c:403: error: call to '_curl_easy_setopt_err_cb_data' declared
    with attribute warning: curl_easy_setopt expects a private data pointer as
    argument for this option

Shouldn't the above be giving a pointer to buf anyway?

 remote-curl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/remote-curl.c b/remote-curl.c
index 297ecf7..256326a 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -400,7 +400,7 @@ static int probe_rpc(struct rpc_state *rpc)
 	curl_easy_setopt(slot->curl, CURLOPT_POSTFIELDSIZE, 4);
 	curl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
-	curl_easy_setopt(slot->curl, CURLOPT_FILE, buf);
+	curl_easy_setopt(slot->curl, CURLOPT_FILE, &buf);
 
 	err = run_slot(slot);
 

Re: [PATCH] smart-http: Don't use Expect: 100-Continue

From: Shawn Pearce <hidden>
Date: 2016-06-15 22:50:34

On Tue, Feb 15, 2011 at 11:42, Junio C Hamano [off-list ref] wrote:
"Shawn O. Pearce" [off-list ref] writes:
quoted
diff --git a/remote-curl.c b/remote-curl.c
index 04d4813..3d82dc2 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -356,14 +356,59 @@ static size_t rpc_in(const void *ptr, size_t eltsize,
...
+static int probe_rpc(struct rpc_state *rpc)
+{
+...
+     curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);
+     curl_easy_setopt(slot->curl, CURLOPT_FILE, buf);
+
+     err = run_slot(slot);
+
+     curl_slist_free_all(headers);
+     strbuf_release(&buf);
+     return err;
+}
Hmm, I am getting

   remote-curl.c:403: error: call to '_curl_easy_setopt_err_cb_data' declared
   with attribute warning: curl_easy_setopt expects a private data pointer as
   argument for this option

Shouldn't the above be giving a pointer to buf anyway?
Yes.  Please squash your patch into mine.  I'm surprised my build
doesn't have sufficient warning flags enabled when I built this. :-(

-- 
Shawn.

Re: [PATCH] smart-http: Don't use Expect: 100-Continue

From: Daniel Stenberg <hidden>
Date: 2016-06-15 22:50:34

On Tue, 15 Feb 2011, Shawn Pearce wrote:
quoted
   remote-curl.c:403: error: call to '_curl_easy_setopt_err_cb_data' declared
   with attribute warning: curl_easy_setopt expects a private data pointer as
   argument for this option
I'm surprised my build doesn't have sufficient warning flags enabled when I 
built this. :-(
Those are warnings generated by the macro magic in curl's typecheck-gcc.h 
header file, and they require gcc 4.3 or later so perhaps you used an older 
compiler?

-- 

  / daniel.haxx.se
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help