summaryrefslogtreecommitdiff
path: root/src/transports
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3198 from libgit2/cmn/coverityEdward Thomson2015-06-091-5/+5
|\ | | | | A few fixes from Coverity
| * ssh: move NULL check to the free functionCarlos Martín Nieto2015-06-091-5/+5
| | | | | | | | | | | | | | | | Let `ssh_stream_free()` take a NULL stream, as free functions should, and remove the check from the connection setup. The connection setup would not need the check anyhow, as we always have a stream by the time we reach this code.
* | Merge pull request #3175 from git-up/build_warningsCarlos Martín Nieto2015-06-071-0/+6
|\ \ | |/ |/| Fixed build warnings on Xcode 6.1
| * Fixed build warnings on Xcode 6.1Pierre-Olivier Latour2015-06-021-0/+6
| |
* | Change error when running out of ssh agent keysMarius Ungureanu2015-06-021-1/+7
|/
* cred: Check for null values when getting key from memoryMichał Górny2015-05-271-1/+4
| | | | | | The public key field is optional and as such can take NULL. Account for that and do not call strlen() on NULL values. Also assert() for non-NULL values of username & private key.
* cred: Declare GIT_CREDTYPE_SSH_MEMORY unconditionallyMichał Górny2015-05-271-2/+0
| | | | | | | Declare GIT_CREDTYPE_SSH_MEMORY to have consistent API independently of whether libgit2 was built with or without in-memory key passing support. Or rather, to have it at all since build-time definitions are not stored in headers.
* Return an error when ssh memory credentials are not supported.David Calavera2015-05-271-2/+6
| | | | To not modify the external api.
* Add support to read ssh keys from memory.David Calavera2015-05-272-1/+66
|
* errors: add GIT_EEOF to indicate early EOFcmn/server-errorsCarlos Martín Nieto2015-05-202-4/+8
| | | | | | This can be used by tools to show mesages about failing to communicate with the server. The error message in this case will often contain the server's error message, as far as it managed to send anything.
* ssh: read from stderr if stdout is emptyCarlos Martín Nieto2015-05-201-1/+8
| | | | | | | | When we fail to read from stdout, it's typically because the URL was wrong and the server process has sent some output over its stderr output. Read that output and set the error message to whatever we read from it.
* Make "Early EOF" message start with lowercaseMarius Ungureanu2015-05-141-2/+2
|
* local: plug a leak in the progress reportingCarlos Martín Nieto2015-05-141-1/+5
|
* Merge pull request #3103 from libgit2/cmn/local-push-messageEdward Thomson2015-05-131-56/+22
|\ | | | | Use the packbuilder in local push
| * local: use the packbuilder to pushCarlos Martín Nieto2015-05-131-55/+18
| | | | | | | | | | | | | | | | Instead of copying each object individually, as we'd been doing, use the packbuilder which should be faster and give us some feedback. While performing this change, we can hook up the packbuilder's writing to the push progress so the caller knows how far along we are.
| * local: add clarification for non-bare push restrictionCarlos Martín Nieto2015-05-131-1/+4
| |
* | local: send the packbuilder progress via the sidebandCarlos Martín Nieto2015-05-131-0/+29
|/ | | | | Set a callback for the packbuilder so we can send the sideband messages to the caller, formatting them as git would.
* Remove the callbacks struct from the remoteCarlos Martín Nieto2015-05-133-8/+9
| | | | | | | | | | | | | | Having the setting be different from calling its actions was not a great idea and made for the sake of the wrong convenience. Instead of that, accept either fetch options, push options or the callbacks when dealing with the remote. The fetch options are currently only the callbacks, but more options will be moved from setters and getters on the remote to the options. This does mean passing the same struct along the different functions but the typical use-case will only call git_remote_fetch() or git_remote_push() and so won't notice much difference.
* push: remove own copy of callbacksCarlos Martín Nieto2015-05-131-6/+7
| | | | | | | | | The push object knows which remote it's associated with, and therefore does not need to keep its own copy of the callbacks stored in the remote. Remove the copy and simply access the callbacks struct within the remote.
* centralizing all IO buffer size valuesJ Wyman2015-05-111-1/+1
|
* Rename GIT_SSL to GIT_OPENSSLCarlos Martín Nieto2015-04-231-1/+1
| | | | | This is what it's meant all along, but now we actually have multiple implementations, it's clearer to use the name of the library.
* Abstract away the TLS stream implementationCarlos Martín Nieto2015-04-231-2/+2
| | | | | Instead, provide git_tls_stream_new() to ask for the most appropriate encrypted stream and use it in our HTTP transport.
* Add a SecureTransport TLS channelCarlos Martín Nieto2015-04-231-1/+1
| | | | | As an alternative to OpenSSL when we're on OS X. This one can actually take advantage of stacking the streams.
* Merge pull request #2974 from libgit2/cmn/clone-everythingEdward Thomson2015-04-101-1/+2
|\ | | | | Make sure to pack referenced objects for non-branches
| * local: recusrively insert non-branch objects into the packfilecmn/clone-everythingCarlos Martín Nieto2015-03-171-1/+2
| | | | | | | | | | | | | | | | | | When we insert e.g. a tag or tagged object into the packfile, we must make sure to insert any referenced objects as well, or we will have broken links. Use the recursive version of packfile insertion to make sure we send over not just the tagged object but also the objects it references.
* | Merge pull request #2990 from leoyanggit/custom_paramEdward Thomson2015-03-245-5/+15
|\ \ | | | | | | Add a custom param to git_smart_subtransport_definition
| * | Add a custom param to git_smart_subtransport_definitionLeo Yang2015-03-185-5/+15
| | | | | | | | | | | | | | | The smart transport has already take the payload param. For the sub transport a payload param is useful for the implementer.
* | | Merge pull request #2986 from tkelman/mingw_winhttpEdward Thomson2015-03-241-22/+27
|\ \ \ | | | | | | | | WinHTTP for MinGW
| * | | Use swprintf_s everywhere except mingw.orgTony Kelman2015-03-191-3/+7
| | | |
| * | | Fix build on mingw-w64Alex Crichton2015-03-161-2/+2
| | | |
| * | | Win32: Enable WinHTTP for MinGWPhilip Kelley2015-03-161-23/+24
| | | |
* | | | git: make sure to close the network streamCarlos Martín Nieto2015-03-211-0/+1
| |_|/ |/| | | | | | | | | | | In case of a bad url or other error during the connection setup, we close the stream via free.
* | | Merge pull request #2972 from libgit2/cmn/pack-objects-walkEdward Thomson2015-03-171-32/+10
|\ \ \ | | | | | | | | [WIP] Smarter pack-building
| * | | local: let the packbuilder perform smarter object insertioncmn/pack-objects-walkCarlos Martín Nieto2015-03-111-32/+10
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | Currently we use the most naïve and inefficient method for figuring out which objects to send to the remote whereby we end up trying to insert subdirs which have not changed multiple times. Instead, make use of the packbuilder's built-in more efficient method which uses the walk to feed the object list and avoids inserting an object and its descendants.
* | | http: do not try to use the cert callback on unencrypted streamscmn/stream-check-ecCarlos Martín Nieto2015-03-161-1/+2
| |/ |/| | | | | | | | | | | | | | | When the user has a certificate check callback set, we still have to check whether the stream we're using is even capable of providing a certificate. In the case of an unencrypted certificate, do not ask for it from the stream, and do not call the callback.
* | local: create pack with multiple threadscmn/local-pack-threadingCarlos Martín Nieto2015-03-111-0/+3
|/ | | | | | | | | | | | | The default behaviour for the packbuilder is to perform the work in a single thread, which is fine for the public API, but we currently have no way for a user to determine the number of threads to use when creating the packfile, which makes our clone behaviour over the filesystem quite a bit slower than what git offers. This is a very particular scenario, in which we avoid spawning git by being ourselves the server-side, so it's probably ok to auto-set the threading, as the upload-pack process would do if we were talking to git.
* http: enforce the credential typescmn/http-enforce-credCarlos Martín Nieto2015-03-031-0/+5
| | | | | | The user may decide to return any type of credential, including ones we did not say we support. Add a check to make sure the user returned an object of the right type and error out if not.
* Remove the signature from ref-modifying functionsCarlos Martín Nieto2015-03-031-1/+1
| | | | | | | | | | The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
* Make our overflow check look more like gcc/clang'sEdward Thomson2015-02-132-25/+33
| | | | | | | | | Make our overflow checking look more like gcc and clang's, so that we can substitute it out with the compiler instrinsics on platforms that support it. This means dropping the ability to pass `NULL` as an out parameter. As a result, the macros also get updated to reflect this as well.
* Use `size_t` to hold size of arraysEdward Thomson2015-02-121-5/+12
| | | | | | Use `size_t` to hold the size of arrays to ease overflow checking, lest we check for overflow of a `size_t` then promptly truncate by packing the length into a smaller type.
* git_buf_grow_by: increase buf asize incrementallyEdward Thomson2015-02-121-1/+1
| | | | | Introduce `git_buf_grow_by` to incrementally increase the size of a `git_buf`, performing an overflow calculation on the growth.
* allocations: test for overflow of requested sizeEdward Thomson2015-02-127-11/+39
| | | | | Introduce some helper macros to test integer overflow from arithmetic and set error message appropriately.
* Plug some leaksJacques Germishuys2014-12-292-5/+14
|
* local: send 'counting objects' outputcmn/local-proto-progressCarlos Martín Nieto2014-12-161-0/+52
| | | | | Pretend we have a git process at the other end by creating a similar progress output when inserting objects into the packbuilder.
* Merge pull request #2678 from libgit2/cmn/io-streamEdward Thomson2014-12-104-130/+126
|\ | | | | Introduce stackable IO streams
| * Fix a couple of compiler warningsCarlos Martín Nieto2014-12-101-1/+1
| |
| * gitno: remove code which is no longer neededCarlos Martín Nieto2014-12-101-3/+3
| | | | | | | | | | | | Most of the network-facing facilities have been copied to the socket and openssl streams. No code now uses these functions directly anymore, so we can now remove them.
| * ssh: use socket_stream to perform the connectionCarlos Martín Nieto2014-12-101-8/+12
| | | | | | | | | | | | | | | | Having an ssh stream would require extra work for stream capabilities we don't need anywhere else (oob auth and command execution) so for now let's move away from the gitno connection to use socket_stream. We can introduce an ssh stream interface if and as we need it.
| * Port HTTP(S) to the new stream APICarlos Martín Nieto2014-12-101-61/+39
| |
| * Port the TCP transport to the new stream APICarlos Martín Nieto2014-12-101-57/+71
| |