summaryrefslogtreecommitdiff
path: root/src/transports
Commit message (Collapse)AuthorAgeFilesLines
* Fix potential use of uninitialized valuesPatrick Steinhardt2016-12-121-1/+1
|
* transports: smart: do not redeclare loop countersPatrick Steinhardt2016-12-121-4/+4
|
* transports: smart: abort receiving packets on end of streamPatrick Steinhardt2016-11-021-1/+5
| | | | | | | | | | | | When trying to receive packets from the remote, we loop until either an error distinct to `GIT_EBUFS` occurs or until we successfully parsed the packet. This does not honor the case where we are looping over an already closed socket which has no more data, leaving us in an infinite loop if we got a bogus packet size or if the remote hang up. Fix the issue by returning `GIT_EEOF` when we cannot read data from the socket anymore.
* transports: smart: abort ref announcement on early end of streamPatrick Steinhardt2016-11-021-1/+1
| | | | | | | | | | | | | | | | | | | When reading a server's reference announcements via the smart protocol, we expect the server to send multiple flushes before the protocol is finished. If we fail to receive new data from the socket, we will only return an end of stream error if we have not seen any flush yet. This logic is flawed in that we may run into an infinite loop when receiving a server's reference announcement with a bogus flush packet. E.g. assume the last flushing package is changed to not be '0000' but instead any other value. In this case, we will still await one more flush package and ignore the fact that we are not receiving any data from the socket, causing an infinite loop. Fix the issue by always returning `GIT_EEOF` if the socket indicates an end of stream.
* transports: http: reset `connected` flag when closing transportPatrick Steinhardt2016-08-171-0/+2
|
* transports: http: reset `connected` flag when re-connecting transportPatrick Steinhardt2016-08-171-0/+1
| | | | | | | | | | | | | When calling `http_connect` on a subtransport whose stream is already connected, we first close the stream in case no keep-alive is in use. When doing so, we do not reset the transport's connection state, though. Usually, this will do no harm in case the subsequent connect will succeed. But when the connection fails we are left with a substransport which is tagged as connected but which has no valid stream attached. Fix the issue by resetting the subtransport's connected-state when closing its stream in `http_connect`.
* remove conditions that prevent use of custom TLS streamwildart2016-07-061-2/+1
|
* HTTP authentication scheme name is case insensitive.David Brooks2016-06-191-1/+1
|
* Merge pull request #3816 from pks-t/pks/memory-leaksEdward Thomson2016-06-141-2/+16
|\ | | | | Memory leak fixes
| * winhttp: plug several memory leaksPatrick Steinhardt2016-06-071-2/+16
| |
* | transports: smart: fix potential invalid memory dereferencesPatrick Steinhardt2016-06-072-0/+12
|/ | | | | | | | | | | | | | | | | | | | | | | When we receive a packet of exactly four bytes encoding its length as those four bytes it can be treated as an empty line. While it is not really specified how those empty lines should be treated, we currently ignore them and do not return an error when trying to parse it but simply advance the data pointer. Callers invoking `git_pkt_parse_line` are currently not prepared to handle this case as they do not explicitly check this case. While they could always reset the passed out-pointer to `NULL` before calling `git_pkt_parse_line` and determine if the pointer has been set afterwards, it makes more sense to update `git_pkt_parse_line` to set the out-pointer to `NULL` itself when it encounters such an empty packet. Like this it is guaranteed that there will be no invalid memory references to free'd pointers. As such, the issue has been fixed such that `git_pkt_parse_line` always sets the packet out pointer to `NULL` when an empty packet has been received and callers check for this condition, skipping such packets.
* transport: cast away constness for freeEdward Thomson2016-04-211-1/+1
|
* proxy: don't specify the protocol in the typeCarlos Martín Nieto2016-04-192-2/+2
| | | | | | We leave this up to the scheme in the url field. The type should only tell us about whether we want a proxy and whether we want to auto-detect it.
* winhttp: correctly detect HTTPS usageCarlos Martín Nieto2016-04-191-2/+14
|
* net: use proxy options struct in the stream configCarlos Martín Nieto2016-04-191-9/+32
|
* proxy: don't require the trailing slash on WinHTTPCarlos Martín Nieto2016-04-191-1/+2
| | | | | The path is not something that you use for proxies, so make use of the new optionality of the path when extracting URL parts.
* proxy: use poxy to test our Windows proxy supportCarlos Martín Nieto2016-04-191-0/+1
|
* proxy: ask the user for credentials if necessaryCarlos Martín Nieto2016-04-194-12/+127
|
* Merge pull request #3574 from chescock/buffer-sideband-pack-dataCarlos Martín Nieto2016-03-241-17/+61
|\ | | | | Buffer sideband packet data
| * Only buffer if necessary.Chris Hescock2016-03-081-18/+39
| |
| * Buffer sideband packet dataChris Hescock2016-01-121-18/+41
| | | | | | | | The inner packet may be split across multiple sideband packets.
* | Merge pull request #3555 from cbargren/ssh-git-protocolsEdward Thomson2016-03-081-17/+32
|\ \ | | | | | | Support for ssh+git and git+ssh protocols
| * | Removing #define for SSH_PREFIX_COUNT and using ARRAY_SIZE insteadChris Bargren2015-12-281-6/+5
| | | | | | | | | Also moving var declarations to top of blocks to support bad old compilers
| * | Handle git+ssh:// and ssh+git:// protocols supportChris Bargren2015-12-221-17/+33
| | |
* | | ssh: initialize libssh2cmn/init-libssh2Carlos Martín Nieto2016-03-032-0/+28
| | | | | | | | | | | | | | | | | | | | | We should have been doing this, but it initializes itself upon first use, which works as long as nobody's doing concurrent network operations. Initialize it on our init to make sure it's not getting initialized concurrently.
* | | winhttp: retry authenticationCarlos Martín Nieto2016-03-031-2/+3
| | | | | | | | | | | | | | | | | | If the caller has provided bad authentication, give them another apportunity to get it right until they give up. This brings WinHTTP in line with the other transports.
* | | transports: smart_pkt: fix memory leaks on error pathsPatrick Steinhardt2016-02-231-10/+11
| | |
* | | smart_pkt: check buffer with GITERR_CHECK_ALLOC_BUFPatrick Steinhardt2016-02-231-1/+3
| | |
* | | transports: smart_pkt: fix memory leaksPatrick Steinhardt2016-02-181-0/+3
| | |
* | | transports: smart: fix memory leak on OOM pathPatrick Steinhardt2016-02-181-0/+2
| | |
* | | winhttp: use an unsigned iteratorEdward Thomson2016-02-161-1/+1
| | |
* | | winhttp: name mangle class / iid on mingwEdward Thomson2016-01-191-2/+7
| |/ |/| | | | | | | | | | | | | Standard Windows type systems define CLSID_InternetSecurityManager and IID_IInternetSecurityManager, but MinGW lacks these definitions. As a result, we must hardcode these definitions ourselves. However, we should not use a public struct with those names, lest another library do the same thing and consumers cannot link to both.
* | ssh_stream_read(): fix possible *bytes_read < 0 branchMichał Górny2015-12-261-3/+8
|/ | | | | | Fix the possibility of returning successfully from ssh_stream_read() with *bytes_read < 0. This would occur if stdout channel read resulted in 0, and stderr channel read failed afterwards.
* Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.Chris Hescock2015-12-011-1/+4
|
* winhttp: use a custom user-agent if the user has set itCarlos Martín Nieto2015-11-121-2/+34
| | | | | We also keep the "git/1.0" prefix in order to maintain compatibility with hosters.
* http: use a custom user-agent if the user has set itCarlos Martín Nieto2015-11-121-1/+12
| | | | | We still prefix it with "git/1.0" since that's required in many situations, but we replace the area which mentions libgit2.
* git: put NULL check at the topCarlos Martín Nieto2015-10-301-2/+5
|
* git: accept NULL as argument to its stream freeCarlos Martín Nieto2015-10-301-2/+2
|
* Merge pull request #3411 from spraints/custom-push-headersCarlos Martín Nieto2015-09-304-0/+106
|\ | | | | Include custom HTTP headers
| * Copy custom_headers insteach of referencing the caller's copyMatt Burke2015-09-254-23/+25
| |
| * These can be staticMatt Burke2015-09-241-3/+3
| |
| * Revise custom header error messagesMatt Burke2015-09-241-40/+44
| | | | | | | | | | | | | | | | If the header doesn't look like a header (e.g. if it doesn't have a ":" or if it has newlines), report "custom HTTP header '%s' is malformed". If the header has the same name as a header already set by libgit2 (e.g. "Host"), report "HTTP header '%s' is already set by libgit2".
| * Don't null-checkMatt Burke2015-09-241-3/+0
| |
| * Use an array of forbidden custom headersMatt Burke2015-09-241-9/+12
| |
| * Add a test for custom header validationMatt Burke2015-09-101-6/+12
| | | | | | | | Also, *some* custom headers actually are valid.
| * More specific namesMatt Burke2015-09-101-4/+4
| |
| * Validate custom http headersMatt Burke2015-09-101-0/+53
| |
| * Ignore NULL headersMatt Burke2015-09-102-11/+14
| |
| * o iMatt Burke2015-09-081-0/+1
| |
| * Teach winhttp about the extra headersMatt Burke2015-09-081-0/+17
| |