Re: [Resend PATCH 2/4] Use strbuf in http code
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 11, 2007, 06:04 UTC
- Message-ID
- <7vlk81him3.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <1197228659-19459-1-git-send-email-mh@glandium.org>
Mike Hommey <mh@glandium.org> writes:
Show 14 quoted lines
> Also, replace whitespaces with tabs in some places > > Signed-off-by: Mike Hommey <mh@glandium.org> > --- > > 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
Show 23 quoted lines
> 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.
Show 9 quoted lines
> @@ -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?