Set HTTP user agent to git/GIT_VERSION
Useful for diagnostics/troubleshooting to know which client versions are hitting your server. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
Nick Hengeveld committed
Apr 4, 2006 at 10:11 UTC
20fc9bc5e4fdd4b1f7fd98fbd2e91879f945d7e1
2 files changed
+5
Makefile
+3
@@ -510,6 +510,9 @@ git$X git.spec \
510
exec_cmd.o: exec_cmd.c
511
$(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $<
512
513
+http.o: http.c
514
+ $(CC) -o $*.o -c $(ALL_CFLAGS) -DGIT_USER_AGENT='"git/$(GIT_VERSION)"' $<
515
+
516
git-%$X: %.o $(GITLIBS)
517
$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
518
http.c
+2
@@ -195,6 +195,8 @@ static CURL* get_curl_handle(void)
195
if (getenv("GIT_CURL_VERBOSE"))
196
curl_easy_setopt(result, CURLOPT_VERBOSE, 1);
197
198
+ curl_easy_setopt(result, CURLOPT_USERAGENT, GIT_USER_AGENT);
199
+
200
return result;
201
}
202