summaryrefslogtreecommitdiff
path: root/src/pkt.c
Commit message (Collapse)AuthorAgeFilesLines
* Reorganize transport architecture (squashed 3)Philip Kelley2012-11-011-427/+0
|
* fetch: use the include-tag capabilityCarlos Martín Nieto2012-09-301-0/+3
| | | | | This tells the remote to send us any tags that point to objects that we are downloading.
* network: add sideband supportCarlos Martín Nieto2012-08-241-2/+49
| | | | | This lets us notify the user of what the remote end is doing while we wait for it to start sending us the packfile.
* remote: use the same code to control git and httpCarlos Martín Nieto2012-07-301-3/+17
| | | | | | | | This allows us to add capabilitites to both at the same time, keeps them in sync and removes a lot of code. gitno_buffer now uses a callback to fill its buffer, allowing us to use the same interface for git and http (which uses callbacks).
* network: implement multi_ack for the git transportCarlos Martín Nieto2012-07-301-5/+13
|
* pkt: correctly advertise capabilititesCarlos Martín Nieto2012-07-131-1/+1
| | | | | | | | | | The correct way to advertise out capabilities is by appending them to the first 'want' line, using SP as separator, instead of NUL as the server does. Inconsistent documentation lead to the use of NUL in libgit2. Fix this so we can request much more efficient packs from the remote which reduces the indexing time considerably.
* http: add https support when GnuTLS is availableCarlos Martín Nieto2012-05-191-6/+0
| | | | | | | | If it's not available, an error saying so will be returned when trying to use a https:// URL. This also unifies a lot of the network code to use git_transport in many places instead of an socket descriptor.
* errors: Rename error codesbreaking-changesVicent Martí2012-05-181-2/+2
|
* errors: Rename the generic return codesVicent Martí2012-05-181-2/+2
|
* Minor error fixesCarlos Martín Nieto2012-05-081-0/+1
| | | | | | | Clear the error in pkt when we notice that the remote is starting to send the packfile. Fix the format string for Windows networking errors.
* Merge pull request #654 from carlosmn/pkt-errVicent Martí2012-04-301-0/+21
|\ | | | | Recognize and report server-side error messages
| * net: recognize and report server-side error messagesCarlos Martín Nieto2012-04-301-0/+21
| | | | | | | | | | When e.g. a repository isn't found, the server sends an error saying so. Put that error message in our error buffer.
* | buf: deploy git_buf_len()nulltoken2012-04-301-1/+1
|/
* pkt: bring back GIT_ESHORTBUFFERCarlos Martín Nieto2012-04-291-8/+4
| | | | | | The recent 64-bit Windows fixes changed the return code in git_pkt_parse_line() so it wouldn't signal a short buffer, breaking the network code. Bring it back.
* transports: buffer the git requests before sending themCarlos Martín Nieto2012-04-251-68/+0
| | | | | | Trying to send every single line immediately won't give us any speed improvement and duplicates the code we need for other transports. Make the git transport use the same buffer functions as HTTP.
* Fix warnings on 64-bit windows buildsRussell Belfer2012-04-171-35/+42
| | | | | This fixes all the warnings on win64 except those in deps, which come from the regex code.
* error-handling: protocol, pktCarlos Martín Nieto2012-04-111-67/+50
|
* Clean up GIT_UNUSED macros on all platformsRussell Belfer2012-03-021-3/+3
| | | | | | | | | | | | | | | | | | | It turns out that commit 31e9cfc4cbcaf1b38cdd3dbe3282a8f57e5366a5 did not fix the GIT_USUSED behavior on all platforms. This commit walks through and really cleans things up more thoroughly, getting rid of the unnecessary stuff. To remove the use of some GIT_UNUSED, I ended up adding a couple of new iterators for hashtables that allow you to iterator just over keys or just over values. In making this change, I found a bug in the clar tests (where we were doing *count++ but meant to do (*count)++ to increment the value). I fixed that but then found the test failing because it was not really using an empty repo. So, I took some of the code that I wrote for iterator testing and moved it to clar_helpers.c, then made use of that to make it easier to open fixtures on a per test basis even within a single test file.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-071-9/+4
| | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* remote: Cleanup the remotes coderepo-ownershipVicent Marti2011-11-281-12/+12
| | | | | | - Hide the remaining transports code - Drop `git_headarray`, switch to using a callback to list refs. Makes the code cleaner.
* global: Properly use `git__` memory wrappersVicent Marti2011-10-281-3/+3
| | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* pkt: move the protocol strings to the top of the fileCarlos Martín Nieto2011-10-121-17/+14
| | | | | | Put them all together so we know where to find them. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* pkt: get rid of the chunked supportCarlos Martín Nieto2011-10-121-28/+5
| | | | | | It was a bad idea. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* http: simple negotiationCarlos Martín Nieto2011-10-121-0/+1
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Introduce the git_pkt_buffer_ family of functionsCarlos Martín Nieto2011-10-121-21/+82
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* net,pkt: add chunked supportCarlos Martín Nieto2011-10-121-12/+40
| | | | | | | | | As we don't know the length of the message we want to send to the other end, we send a chunk size before each message. In later versions, sending the wants might benefit from batching the lines together. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* pkt: send all of the wants in the negotiationCarlos Martín Nieto2011-10-011-1/+3
| | | | | | | A missing if caused the function to return after the first want line without capabilities. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Merge pull request #421 from nulltoken/ntk/fix/config-get-set-longVicent Martí2011-09-221-1/+1
|\ | | | | config: make git_config_[get|set]_long() able to properly deal with 8 bytes wide values
| * config: make git_config_[get|set]_long() able to properly deal with 8 bytes ↵nulltoken2011-09-221-1/+1
| | | | | | | | | | | | | | | | wide values Should fix issue #419. Signed-off-by: nulltoken <emeric.fermas@gmail.com>
* | Merge pull request #405 from carlosmn/http-lsVicent Martí2011-09-221-5/+21
|\ \ | |/ |/| Implement ls-remote over HTTP
| * pkt: add the comment typeCarlos Martín Nieto2011-09-091-0/+19
| | | | | | | | | | | | This is needed for smart HTTP Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
| * pkt: don't use strlen before we know the name is NUL-terminatedCarlos Martín Nieto2011-09-071-5/+2
| | | | | | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* | Tabify everythingVicent Marti2011-09-191-4/+4
| | | | | | | | | | | | There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.
* | Cleanup legal dataVicent Marti2011-09-191-21/+3
|/ | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* pkt: use sizeof() instead of strlen() to avoid variable length arrayKirill A. Shutemov2011-08-261-1/+1
| | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* Drop STRLEN() macrosKirill A. Shutemov2011-08-251-9/+9
| | | | | | | There is no need in STRLEN macros. Compilers can do this trivial optimization on its own. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* posix: Properly handle `snprintf` in all platformsVicent Marti2011-08-181-1/+2
|
* Actually implement object negotiationCarlos Martín Nieto2011-08-181-12/+21
| | | | | | | | Only signal that we need a pack if we do need it and don't send a want just because it's the first. If we don't need to download the pack, then we can skip all of the negotiation and just return success. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Remove enum git_whnCarlos Martín Nieto2011-08-181-2/+2
| | | | | | Instead, use flags inside the git_remote_head structure. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Use common capabilitiesCarlos Martín Nieto2011-08-181-3/+33
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Download packCarlos Martín Nieto2011-08-181-15/+36
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Move have sendingCarlos Martín Nieto2011-08-181-51/+52
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Implement sending havesCarlos Martín Nieto2011-08-181-1/+64
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* negotiationCarlos Martín Nieto2011-08-181-1/+1
|
* git_pkt_send_wantsCarlos Martín Nieto2011-08-181-0/+26
|
* Cleanup external APIVicent Marti2011-07-111-2/+3
| | | | | Some of the WIP API calls have been hidden in preparation for the next minor release.
* Use gitno_buffer in the git transportCarlos Martín Nieto2011-06-271-1/+2
| | | | | | This allows us to leave out the buffer handling logic. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Move git_pkt_{gen_proto,send_request} to transport_git.cCarlos Martín Nieto2011-06-261-58/+0
| | | | | | | This is where they really belong. Remvoe the prefix and make them static. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* Use (s)size_tCarlos Martín Nieto2011-06-261-3/+3
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>