{"thread":{"id":"3792","subject":"[PATCH] Set HTTP user agent to git/GIT_VERSION","startedAt":"2006-04-04T17:11:29Z","lastAt":"2006-04-04T17:11:29Z","messageCount":1,"participants":["Nick Hengeveld"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18347","messageId":"20060404171128.GD14967@reactrix.com","threadId":"3792","inReplyTo":null,"subject":"[PATCH] Set HTTP user agent to git/GIT_VERSION","fromName":"Nick Hengeveld","fromEmail":"nickh@reactrix.com","sentAt":"2006-04-04T17:11:29Z","receivedAt":"2006-04-04T17:11:29Z","isPatch":true,"sender":{"key":"nickh@reactrix.com","avatar":null},"body":"Useful for diagnostics/troubleshooting to know which client versions are\nhitting your server.\n\nSigned-off-by: Nick Hengeveld <nickh@reactrix.com>\n\n\n---\n\n Makefile |    3 +++\n http.c   |    2 ++\n 2 files changed, 5 insertions(+), 0 deletions(-)\n\n468d4d4ac3cbdb0757a7cc1c207ca379ce3a5d56\ndiff --git a/Makefile b/Makefile\nindex 19ce42c..c7d5ecf 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -510,6 +510,9 @@ git$X git.spec \\\n exec_cmd.o: exec_cmd.c\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH=\"$(gitexecdir_SQ)\"' $<\n \n+http.o: http.c\n+\t$(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='\"git/$(GIT_VERSION)\"' $<\n+\n ifdef NO_EXPAT\n http-fetch.o: http-fetch.c\n \t$(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_EXPAT $<\ndiff --git a/http.c b/http.c\nindex 9604e33..0cb42a8 100644\n--- a/http.c\n+++ b/http.c\n@@ -195,6 +195,8 @@ #endif\n \tif (getenv(\"GIT_CURL_VERBOSE\"))\n \t\tcurl_easy_setopt(result, CURLOPT_VERBOSE, 1);\n \n+\tcurl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT);\n+\n \treturn result;\n }\n \n-- \n1.3.0.rc1.g9aef-dirty\n"}]}