summaryrefslogtreecommitdiff
path: root/http.h
Commit message (Collapse)AuthorAgeFilesLines
* Work around gcc warnings from curl headersJunio C Hamano2008-07-041-6/+3
| | | | | | | | | | | | | | After master.k.org upgrade, I started seeing these warning messages: transport.c: In function 'get_refs_via_curl': transport.c:458: error: call to '_curl_easy_setopt_err_write_callback' declared with attribute warning: curl_easy_setopt expects a curl_write_callback argument for this option It appears that the curl header wants to enforce the function signature for callback function given to curl_easy_setopt() to be compatible with that of (*curl_write_callback) or fwrite. This patch seems to work the issue around. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make walker.fetch_ref() take a struct ref.Daniel Barkalow2008-04-261-1/+1
| | | | | | | | | | | | | | | | This simplifies a few things, makes a few things slightly more complicated, but, more importantly, allows that, when struct ref can represent a symref, http_fetch_ref() can return one. Incidentally makes the string that http_fetch_ref() gets include "refs/" (if appropriate), because that's how the name field of struct ref works. As far as I can tell, the usage in walker:interpret_target() wouldn't have worked previously, if it ever would have been used, which it wouldn't (since the fetch process uses the hash instead of the name of the ref there). Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Set proxy override with http_init()Mike Hommey2008-02-271-1/+2
| | | | | | | | | | | | | | | | | | | | In transport.c, proxy setting (the one from the remote conf) was set through curl_easy_setopt() call, while http.c already does the same with the http.proxy setting. We now just use this infrastructure instead, and make http_init() now take the struct remote as argument so that it can take the http_proxy setting from there, and any other property that would be added later. At the same time, we make get_http_walker() take a struct remote argument too, and pass it to http_init(), which makes remote defined proxy be used for more than get_refs_via_curl(). We leave out http-fetch and http-push, which don't use remotes for the moment, purposefully. Signed-off-by: Mike Hommey <mh@glandium.org> Acked-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Clarify that http-push being temporarily disabled with older cURLJunio C Hamano2008-01-221-0/+8
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Move fetch_ref from http-push.c and http-walker.c to http.cMike Hommey2007-12-141-0/+2
| | | | | | | | Make the necessary changes to be ok with their difference, and rename the function http_fetch_ref. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Use strbuf in http codeMike Hommey2007-12-141-5/+6
| | | | | | | Also, replace whitespaces with tabs in some places Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Avoid redundant declaration of missing_target()Mike Hommey2007-12-141-0/+13
| | | | | Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Cleanup variables in http.[ch]Mike Hommey2007-12-091-18/+0
| | | | | | | | Quite some variables defined as extern in http.h are only used in http.c, and some others, only defined in http.c, were not static. Signed-off-by: Mike Hommey <mh@glandium.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Make function to refill http queue a callbackDaniel Barkalow2007-09-191-3/+1
| | | | | | | | | | | This eliminates the last function provided by the code using http.h as a global symbol, so it should be possible to have multiple programs using http.h in the same executable, and it also adds an argument to that callback, so that info can be passed into the callback without being global. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Refactor http.h USE_CURL_MULTI fill_active_slots().Daniel Barkalow2007-09-191-6/+3
| | | | | | | | This removes all of the boilerplate and http-internal stuff from fill_active_slots() and makes it easy to turn into a callback. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* http-fetch: Disable use of curl multi support for libcurl < 7.16.Alexandre Julliard2007-05-031-1/+1
| | | | | | | | | | curl_multi_remove_handle() is broken in libcurl < 7.16, in that it doesn't correctly update the active handles count when a request is aborted. This causes the transfer to hang forever waiting for the handle count to become less than the number of active requests. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Work around http-fetch built with cURL 7.16.0Junio C Hamano2006-12-271-1/+1
| | | | | | | | | | | It appears that curl_easy_duphandle() from libcurl 7.16.0 returns a curl session handle which fails GOOD_MULTI_HANDLE() check in curl_multi_add_handle(). This causes fetch_ref() to fail because start_active_slot() cannot start the request. For now, check for 7.16.0 to work this issue around. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Patch for http-fetch.c and older curl releasesArt Haas2006-09-201-0/+4
| | | | | | | | | | | | | | | | Older curl releases do not define CURLE_HTTP_RETURNED_ERROR, they use CURLE_HTTP_NOT_FOUND instead. Newer curl releases keep the CURLE_HTTP_NOT_FOUND definition but using a -DCURL_NO_OLDIES preprocessor flag the old name will not be present in the 'curl.h' header. This patch makes our code written for newer releases of the curl library but allow compiling against an older curl (older than 0x070a03) by defining the missing CURLE_HTTP_RETURNED_ERROR as a synonym for CURLE_HTTP_NOT_FOUND. Signed-off-by: Art Haas <ahaas@airmail.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* HTTP slot reuse fixesNick Hengeveld2006-03-101-0/+1
| | | | | | | | Incorporate into http-push a fix related to accessing slot results after the slot was reused, and fix a case in run_active_slot where a finished slot wasn't detected if the slot was reused. Signed-off-by: Junio C Hamano <junkio@cox.net>
* http-fetch: Abort requests for objects which arrived in packsMark Wooding2006-02-071-0/+1
| | | | | | | | | | In fetch_object, there's a call to release an object request if the object mysteriously arrived, say in a pack. Unfortunately, the fetch attempt for this object might already be in progress, and we'll leak the descriptor. Instead, try to tidy away the request. Signed-off-by: Mark Wooding <mdw@distorted.org.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix HTTP request result processing after slot reuseNick Hengeveld2006-01-311-0/+7
| | | | | | | | Add a way to store the results of an HTTP request when a slot finishes so the results can be processed after the slot has been reused. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Isolate shared HTTP request functionalityNick Hengeveld2005-11-191-0/+95
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. Signed-off-by: Nick Hengeveld <nickh@reactrix.com> Signed-off-by: Junio C Hamano <junkio@cox.net>