Skip to contentSkip to conversation

Isolate shared HTTP request functionality

PATCH New Nick Hengeveld 1 participant 1 message Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/5 Isolate shared HTTP request functionality

Move shared HTTP request functionality out of http-fetch and http-push, and replace the two fwrite_buffer/fwrite_buffer_dynamic functions with one fwrite_buffer function that does dynamic buffering. Use slot callbacks to process responses to fetch object transfer requests and push transfer requests, and put all of http-push into an #ifdef check for curl multi support.

---

 Makefile     |    3 
 http-fetch.c |  586 ++++++----------------------------------------------------
 http-push.c  |  484 ++++--------------------------------------------
 http.c       |  443 ++++++++++++++++++++++++++++++++++++++++++++
 http.h       |   95 +++++++++
 5 files changed, 635 insertions(+), 976 deletions(-)
 create mode 100644 http.c
 create mode 100644 http.h

applies-to: ae209db4abcd6d0c83ac92c23bb9b16ffd5bcf7e 4e68fe30c4999c9b1ad40ab562df61d9c267b8a2

Makefile +2 -1
index 3bdd059..59c9a44 100644
@@ -383,7 +383,8 @@ $(SIMPLE_PROGRAMS) : git-%$X : %.o
 	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 		$(LIB_FILE) $(SIMPLE_LIB)
 
-git-http-fetch$X: fetch.o
+git-http-fetch$X: fetch.o http.o
+git-http-push$X: http.o
 git-local-fetch$X: fetch.o
 git-ssh-fetch$X: rsh.o fetch.o
 git-ssh-upload$X: rsh.o
http-fetch.c +59 -527

752 lines not on this page · raw message

http-push.c +36 -448

640 lines not on this page · raw message

http.c new file +443 -0

443 lines not on this page · raw message

http.h new file +95 -0

95 lines not on this page · raw message

---
0.99.9.GIT