1. 03 4月, 2009 1 次提交
    • M
      Allow curl to rewind the read buffers · 3944ba0c
      Martin Storsjö 提交于
      When using multi-pass authentication methods, the curl library may
      need to rewind the read buffers (depending on how much already has
      been fed to the server) used for providing data to HTTP PUT, POST or
      PROPFIND, and in order to allow the library to do so, we need to tell
      it how by providing either an ioctl callback or a seek callback.
      
      This patch adds an ioctl callback, which should be usable on older
      curl versions (since 7.12.3) than the seek callback (introduced in
      curl 7.18.0).
      
      Some HTTP servers (such as Apache) give an 401 error reply immediately
      after receiving the headers (so no data has been read from the read
      buffers, and thus no rewinding is needed), but other servers (such
      as Lighttpd) only replies after the whole request has been sent and
      all data has been read from the read buffers, making rewinding necessary.
      Signed-off-by: NMartin Storsjo <martin@martin.st>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3944ba0c
  2. 13 3月, 2009 1 次提交
  3. 11 3月, 2009 2 次提交
    • J
      http authentication via prompts · c33976cb
      Junio C Hamano 提交于
      Curl is designed not to ask for password when only username is given in
      the URL, but has a way for application to feed a (username, password) pair
      to it.  With this patch, you do not have to keep your password in
      plaintext in your $HOME/.netrc file when talking with a password protected
      URL with http://<username>@<host>/path/to/repository.git/ syntax.
      
      The code handles only the http-walker side, not the push side.  At least,
      not yet.  But interested parties can add support for it.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      c33976cb
    • J
      http_init(): Fix config file parsing · 7059cd99
      Junio C Hamano 提交于
      We honor the command line options, environment variables, variables in
      repository configuration file, variables in user's global configuration
      file, variables in the system configuration file, and then finally use
      built-in default.  To implement this semantics, the code should:
      
       - start from built-in default values;
      
       - call git_config() with the configuration parser callback, which
         implements "later definition overrides earlier ones" logic
         (git_config() reads the system's, user's and then repository's
         configuration file in this order);
      
       - override the result from the above with environment variables if set;
      
       - override the result from the above with command line options.
      
      The initialization code http_init() for http transfer got this wrong, and
      implemented a "first one wins, ignoring the later ones" in http_options(),
      to compensate this mistake, read environment variables before calling
      git_config().  This is all wrong.
      
      As a second class citizen, the http codepath hasn't been audited as
      closely as other parts of the system, but we should try to bring sanity to
      it, before inviting contributors to improve on it.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7059cd99
  4. 10 3月, 2009 1 次提交
  5. 08 3月, 2009 1 次提交
  6. 07 12月, 2008 1 次提交
  7. 10 9月, 2008 1 次提交
  8. 08 9月, 2008 1 次提交
  9. 06 7月, 2008 1 次提交
  10. 04 7月, 2008 1 次提交
    • J
      Work around gcc warnings from curl headers · f444e528
      Junio C Hamano 提交于
      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: NJunio C Hamano <gitster@pobox.com>
      f444e528
  11. 15 6月, 2008 1 次提交
  12. 15 5月, 2008 1 次提交
  13. 27 4月, 2008 2 次提交
  14. 04 3月, 2008 1 次提交
  15. 28 2月, 2008 1 次提交
    • M
      Set proxy override with http_init() · 9fc6440d
      Mike Hommey 提交于
      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: NMike Hommey <mh@glandium.org>
      Acked-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9fc6440d
  16. 12 2月, 2008 1 次提交
  17. 15 12月, 2007 3 次提交
  18. 10 12月, 2007 1 次提交
  19. 04 12月, 2007 1 次提交
  20. 19 9月, 2007 3 次提交
    • S
      Properly cleanup in http_cleanup so builtin-fetch does not segfault · 3278cd0a
      Shawn O. Pearce 提交于
      Junio and I both noticed that the new builtin-fetch was segfaulting
      immediately on http/https/ftp style URLs (those that went through
      libcurl and the commit walker).  Although the builtin-fetch changes
      in this area were really just minor refactorings there was one major
      change made: we invoked http_init(), http_cleanup() then http_init()
      again in the same process.
      
      When we call curl_easy_cleanup() on each active_request_slot we
      are telling libcurl we did not want that buffer to be used again.
      Unfortunately we did not also deallocate the active_request_slot
      itself nor did we NULL out active_queue_head.  This lead us to
      attempt to reuse these cleaned up libcurl handles when we later tried
      to invoke http_init() a second time to reactivate the curl library.
      The next file get operation then immediately segfaulted on most
      versions of libcurl.
      
      Properly freeing our own buffers and clearing the list causes us to
      reinitialize the curl buffers again if/when we need to use libcurl
      from within this same process.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      3278cd0a
    • D
      Make function to refill http queue a callback · fc57b6aa
      Daniel Barkalow 提交于
      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: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fc57b6aa
    • D
      Refactor http.h USE_CURL_MULTI fill_active_slots(). · 45c17412
      Daniel Barkalow 提交于
      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: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      45c17412
  21. 07 6月, 2007 1 次提交
    • J
      War on whitespace · a6080a0a
      Junio C Hamano 提交于
      This uses "git-apply --whitespace=strip" to fix whitespace errors that have
      crept in to our source files over time.  There are a few files that need
      to have trailing whitespaces (most notably, test vectors).  The results
      still passes the test, and build result in Documentation/ area is unchanged.
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a6080a0a
  22. 29 4月, 2007 1 次提交
  23. 29 9月, 2006 1 次提交
  24. 20 6月, 2006 1 次提交
  25. 07 6月, 2006 1 次提交
  26. 01 6月, 2006 1 次提交
  27. 05 4月, 2006 1 次提交
  28. 11 3月, 2006 1 次提交
    • N
      HTTP slot reuse fixes · baa7b67d
      Nick Hengeveld 提交于
      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: NJunio C Hamano <junkio@cox.net>
      baa7b67d
  29. 07 2月, 2006 1 次提交
  30. 06 2月, 2006 1 次提交
  31. 01 2月, 2006 1 次提交
  32. 20 11月, 2005 2 次提交