From: Junio C Hamano Date: Tue, 11 Dec 2007 06:04:52 GMT Subject: Re: [Resend PATCH 2/4] Use strbuf in http code Message-ID: <7vlk81him3.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1197228659-19459-1-git-send-email-mh@glandium.org> Mike Hommey writes: > Also, replace whitespaces with tabs in some places > > Signed-off-by: Mike Hommey > --- > > 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 > diff --git a/http.h b/http.h > index fe1b0d1..bf3f12c 100644 > --- a/http.h > +++ b/http.h > @@ -6,6 +6,8 @@ > #include > #include > > +#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. > @@ -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?