{"thread":{"id":"21545","subject":"[PATCH 1/3] http-backend: Fix symbol clash on AIX 5.3","startedAt":"2009-11-09T18:10:35Z","lastAt":"2009-11-09T18:37:52Z","messageCount":5,"participants":["Shawn O. Pearce","Tarmigan"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"127177","messageId":"1257790237-30850-1-git-send-email-spearce@spearce.org","threadId":"21545","inReplyTo":null,"subject":"[PATCH 1/3] http-backend: Fix symbol clash on AIX 5.3","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-11-09T18:10:35Z","receivedAt":"2009-11-09T18:10:35Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Mike says:\n> > +static void send_file(const char *the_type, const char *name)\n> > +{\n>\n> I think a symbol clash here is responsible for a build breakage in\n> next on AIX 5.3:\n>\n> CC http-backend.o\n> http-backend.c:213: error: conflicting types for `send_file'\n> /usr/include/sys/socket.h:676: error: previous declaration of `send_file'\n> gmake: *** [http-backend.o] Error 1\n\nSo we rename the function send_local_file().\n\nReported-by: Mike Ralphson <mike.ralphson@gmail.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n http-backend.c |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/http-backend.c b/http-backend.c\nindex 9021266..646e910 100644\n--- a/http-backend.c\n+++ b/http-backend.c\n@@ -209,7 +209,7 @@ static void send_strbuf(const char *type, struct strbuf *buf)\n \tsafe_write(1, buf->buf, buf->len);\n }\n \n-static void send_file(const char *the_type, const char *name)\n+static void send_local_file(const char *the_type, const char *name)\n {\n \tconst char *p = git_path(\"%s\", name);\n \tsize_t buf_alloc = 8192;\n@@ -247,28 +247,28 @@ static void get_text_file(char *name)\n {\n \tselect_getanyfile();\n \thdr_nocache();\n-\tsend_file(\"text/plain\", name);\n+\tsend_local_file(\"text/plain\", name);\n }\n \n static void get_loose_object(char *name)\n {\n \tselect_getanyfile();\n \thdr_cache_forever();\n-\tsend_file(\"application/x-git-loose-object\", name);\n+\tsend_local_file(\"application/x-git-loose-object\", name);\n }\n \n static void get_pack_file(char *name)\n {\n \tselect_getanyfile();\n \thdr_cache_forever();\n-\tsend_file(\"application/x-git-packed-objects\", name);\n+\tsend_local_file(\"application/x-git-packed-objects\", name);\n }\n \n static void get_idx_file(char *name)\n {\n \tselect_getanyfile();\n \thdr_cache_forever();\n-\tsend_file(\"application/x-git-packed-objects-toc\", name);\n+\tsend_local_file(\"application/x-git-packed-objects-toc\", name);\n }\n \n static int http_config(const char *var, const char *value, void *cb)\n-- \n1.6.5.2.351.g09432\n"},{"id":"127178","messageId":"1257790237-30850-2-git-send-email-spearce@spearce.org","threadId":"21545","inReplyTo":"1257790237-30850-1-git-send-email-spearce@spearce.org","subject":"[PATCH 2/3] t5551-http-fetch: Work around some libcurl versions","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-11-09T18:10:36Z","receivedAt":"2009-11-09T18:10:36Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Some versions of libcurl report their output when GIT_CURL_VERBOSE\nis set differently than other versions do.  At least one variant\n(version unknown but likely pre-7.18.1) reports the POST payload to\nstderr, and omits the blank line after each HTTP request/response.\nWe clip these lines out of the stderr output now before doing the\ncompare, so we aren't surprised by this trivial difference.\n\nReported-by: Tarmigan <tarmigan+git@gmail.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n t/t5551-http-fetch.sh |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh\nindex eb0c039..6b0165c 100755\n--- a/t/t5551-http-fetch.sh\n+++ b/t/t5551-http-fetch.sh\n@@ -31,23 +31,19 @@ cat >exp <<EOF\n > GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1\n > Accept: */*\n > Pragma: no-cache\n-\n < HTTP/1.1 200 OK\n < Pragma: no-cache\n < Cache-Control: no-cache, max-age=0, must-revalidate\n < Content-Type: application/x-git-upload-pack-advertisement\n-< \n > POST /smart/repo.git/git-upload-pack HTTP/1.1\n > Accept-Encoding: deflate, gzip\n > Content-Type: application/x-git-upload-pack-request\n > Accept: application/x-git-upload-pack-response\n > Content-Length: xxx\n-\n < HTTP/1.1 200 OK\n < Pragma: no-cache\n < Cache-Control: no-cache, max-age=0, must-revalidate\n < Content-Type: application/x-git-upload-pack-result\n-< \n EOF\n test_expect_success 'clone http repository' '\n \tGIT_CURL_VERBOSE=1 git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err &&\n@@ -56,6 +52,8 @@ test_expect_success 'clone http repository' '\n \tsed -e \"\n \t\ts/Q\\$//\n \t\t/^[*] /d\n+\t\t/^$/d\n+\t\t/^< $/d\n \n \t\t/^[^><]/{\n \t\t\ts/^/> /\n@@ -64,6 +62,8 @@ test_expect_success 'clone http repository' '\n \t\t/^> User-Agent: /d\n \t\t/^> Host: /d\n \t\ts/^> Content-Length: .*/> Content-Length: xxx/\n+\t\t/^00..want /d\n+\t\t/^00.*done/d\n \n \t\t/^< Server: /d\n \t\t/^< Expires: /d\n-- \n1.6.5.2.351.g09432\n"},{"id":"127179","messageId":"1257790237-30850-3-git-send-email-spearce@spearce.org","threadId":"21545","inReplyTo":"1257790237-30850-1-git-send-email-spearce@spearce.org","subject":"[RFC PATCH 3/3] t5551-http-fetch: Work around broken Accept header in libcurl","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2009-11-09T18:10:37Z","receivedAt":"2009-11-09T18:10:37Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Unfortunately at least one version of libcurl has a bug causing\nit to include \"Accept: */*\" in the same POST request where we have\nalready asked for \"Accept: application/x-git-upload-pack-response\".\n\nThis is a bug in libcurl, not Git, or our test vector.  The\napplication has explicitly asked the server for a single content\ntype, but libcurl has mistakenly also told the server the client\napplication will accept */*, which is any content type.\n\nBased on the libcurl change log, this \"Accept: */*\" header bug\nmay have been fixed in version 7.18.1 released March 30, 2008:\n\n  http://curl.haxx.se/changes.html#7_18_1\n\nRather than require users to upgrade libcurl we change the test\nvector to trim this line out of the 2nd request.\n\nReported-by: Tarmigan <tarmigan+git@gmail.com>\nSigned-off-by: Shawn O. Pearce <spearce@spearce.org>\n---\n\n Actually, I don't want to apply this.\n\n Tarmigan, your libcurl is broken, it looks like a newer version\n fixes the problem, so I would suggest upgrading it.\n\n t/t5551-http-fetch.sh |    3 +++\n 1 files changed, 3 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh\nindex 6b0165c..9d59065 100755\n--- a/t/t5551-http-fetch.sh\n+++ b/t/t5551-http-fetch.sh\n@@ -61,6 +61,9 @@ test_expect_success 'clone http repository' '\n \n \t\t/^> User-Agent: /d\n \t\t/^> Host: /d\n+\t\t/^> POST /,$ {\n+\t\t\t/^> Accept: [*]\\\\/[*]/d\n+\t\t}\n \t\ts/^> Content-Length: .*/> Content-Length: xxx/\n \t\t/^00..want /d\n \t\t/^00.*done/d\n-- \n1.6.5.2.351.g09432\n"},{"id":"127182","messageId":"905315640911091036t21321a54u4a4c20d2b2034ad7@mail.gmail.com","threadId":"21545","inReplyTo":"1257790237-30850-2-git-send-email-spearce@spearce.org","subject":"Re: [PATCH 2/3] t5551-http-fetch: Work around some libcurl versions","fromName":"Tarmigan","fromEmail":"tarmigan+git@gmail.com","sentAt":"2009-11-09T18:36:33Z","receivedAt":"2009-11-09T18:36:33Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"On Mon, Nov 9, 2009 at 10:10 AM, Shawn O. Pearce <spearce@spearce.org> wrote:\n> Some versions of libcurl report their output when GIT_CURL_VERBOSE\n> is set differently than other versions do.  At least one variant\n> (version unknown but likely pre-7.18.1) reports the POST payload to\n> stderr, and omits the blank line after each HTTP request/response.\n\nYes, my curl is 7.15.5.\n\n> @@ -56,6 +52,8 @@ test_expect_success 'clone http repository' '\n>        sed -e \"\n>                s/Q\\$//\n>                /^[*] /d\n> +               /^$/d\n> +               /^< $/d\n>\n>                /^[^><]/{\n>                        s/^/> /\n> @@ -64,6 +62,8 @@ test_expect_success 'clone http repository' '\n>                /^> User-Agent: /d\n>                /^> Host: /d\n>                s/^> Content-Length: .*/> Content-Length: xxx/\n> +               /^00..want /d\n> +               /^00.*done/d\n\nAlmost.  This still needs a\n'> '\nbefore both of the 00 additions.  Changing this and applying 3/3 makes\nthe test pass for me.\n\nTested-with-modifications-by: Tarmigan <tarmigan+git@gmail.com>\n"},{"id":"127183","messageId":"905315640911091037i5e99c719rf754db7c95f0b069@mail.gmail.com","threadId":"21545","inReplyTo":"1257790237-30850-3-git-send-email-spearce@spearce.org","subject":"Re: [RFC PATCH 3/3] t5551-http-fetch: Work around broken Accept header in libcurl","fromName":"Tarmigan","fromEmail":"tarmigan+git@gmail.com","sentAt":"2009-11-09T18:37:52Z","receivedAt":"2009-11-09T18:37:52Z","isPatch":true,"sender":{"key":"tarmigan+git@gmail.com","avatar":null},"body":"On Mon, Nov 9, 2009 at 10:10 AM, Shawn O. Pearce <spearce@spearce.org> wrote:\n> Unfortunately at least one version of libcurl has a bug causing\n> it to include \"Accept: */*\" in the same POST request where we have\n> already asked for \"Accept: application/x-git-upload-pack-response\".\n>\n> This is a bug in libcurl, not Git, or our test vector.  The\n> application has explicitly asked the server for a single content\n> type, but libcurl has mistakenly also told the server the client\n> application will accept */*, which is any content type.\n>\n> Based on the libcurl change log, this \"Accept: */*\" header bug\n> may have been fixed in version 7.18.1 released March 30, 2008:\n>\n>  http://curl.haxx.se/changes.html#7_18_1\n>\n> Rather than require users to upgrade libcurl we change the test\n> vector to trim this line out of the 2nd request.\n>\n> Reported-by: Tarmigan <tarmigan+git@gmail.com>\n\nTested-by: Tarmigan <tarmigan+git@gmail.com>\n\n> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>\n"}]}