Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: [Resend PATCH 2/4] Use strbuf in http code

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:57

Possibly related (same subject, not in this thread)

Mike Hommey [off-list ref] writes:
Also, replace whitespaces with tabs in some places

Signed-off-by: Mike Hommey <redacted>
---

 While this doesn't fix the problem with symbolic refs, it does fail more
 cleanly.

 http-push.c   |  187 +++++++++++++++++++--------------------------------------
 http-walker.c |   60 +++++++------------
 http.c        |   34 ++++------
 http.h        |   11 ++--
 transport.c   |   18 ++----
 5 files changed, 109 insertions(+), 201 deletions(-)
I like this code reduction, but
quoted hunk
diff --git a/http.h b/http.h
index fe1b0d1..bf3f12c 100644
--- a/http.h
+++ b/http.h
@@ -6,6 +6,8 @@
 #include <curl/curl.h>
 #include <curl/easy.h>
 
+#include "strbuf.h"
+
 #if LIBCURL_VERSION_NUM >= 0x071000
 #define USE_CURL_MULTI
 #define DEFAULT_MAX_REQUESTS 5
@@ -48,18 +50,17 @@ struct active_request_slot
 
 struct buffer
 {
-        size_t posn;
-        size_t size;
-        void *buffer;
+	struct strbuf buf;
+	size_t posn;
 };
With this definition of "struct buffer", I do not think this can be correct.
quoted hunk
@@ -1267,10 +1257,8 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
 {
 	struct active_request_slot *slot;
 	struct slot_results results;
-	struct buffer out_buffer;
-	struct buffer in_buffer;
-	char *out_data;
-	char *in_data;
+	struct buffer out_buffer = { 0, STRBUF_INIT };
How seriously have you proofread and tested this series before sending
it out?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help