Carlos Martín Nieto
d4763c9861
Merge pull request #3574 from chescock/buffer-sideband-pack-data
...
Buffer sideband packet data
2016-03-24 06:56:25 -07:00
Chris Hescock
9028a8a22a
Only buffer if necessary.
2016-03-08 10:43:37 -05:00
Edward Thomson
b7809b8469
Merge pull request #3555 from cbargren/ssh-git-protocols
...
Support for ssh+git and git+ssh protocols
2016-03-08 13:38:55 +00:00
Carlos Martín Nieto
22f3d3aa6b
ssh: initialize libssh2
...
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.
2016-03-03 22:26:31 +01:00
Carlos Martín Nieto
a4cba9d453
winhttp: retry authentication
...
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.
2016-03-03 11:18:03 +01:00
Patrick Steinhardt
003c5e46a8
transports: smart_pkt: fix memory leaks on error paths
2016-02-23 11:50:23 +01:00
Patrick Steinhardt
6e2a37556d
smart_pkt: check buffer with GITERR_CHECK_ALLOC_BUF
2016-02-23 11:50:23 +01:00
Patrick Steinhardt
b0f7512f40
transports: smart_pkt: fix memory leaks
2016-02-18 20:50:33 +01:00
Patrick Steinhardt
704554cdf0
transports: smart: fix memory leak on OOM path
2016-02-18 20:50:33 +01:00
Edward Thomson
9ce0399c4d
winhttp: use an unsigned iterator
2016-02-16 11:50:49 +00:00
Edward Thomson
5c7f2f0188
winhttp: name mangle class / iid on mingw
...
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.
2016-01-19 11:13:23 -06:00
Chris Hescock
a7d9d93dad
Buffer sideband packet data
...
The inner packet may be split across multiple sideband packets.
2016-01-12 10:08:58 -05:00
Chris Bargren
4df17045c1
Removing #define for SSH_PREFIX_COUNT and using ARRAY_SIZE instead
...
Also moving var declarations to top of blocks to support bad old compilers
2015-12-28 11:45:00 -07:00
Michał Górny
02fdc2db22
ssh_stream_read(): fix possible *bytes_read < 0 branch
...
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.
2015-12-26 17:17:05 +01:00
Chris Bargren
ed21fd745c
Handle git+ssh:// and ssh+git:// protocols support
2015-12-22 10:38:31 -07:00
Chris Hescock
efd9ab568b
Treat GIT_PASSTHROUGH as though git_cred_acquire_cb isn't set.
2015-12-01 10:54:20 -05:00
Carlos Martín Nieto
1411cb9eb5
winhttp: use a custom user-agent if the user has set it
...
We also keep the "git/1.0" prefix in order to maintain compatibility
with hosters.
2015-11-12 17:18:42 +01:00
Carlos Martín Nieto
94bac76c3f
http: use a custom user-agent if the user has set it
...
We still prefix it with "git/1.0" since that's required in many
situations, but we replace the area which mentions libgit2.
2015-11-12 17:18:42 +01:00
Carlos Martín Nieto
e0be1d605f
git: put NULL check at the top
2015-10-30 18:23:17 +01:00
Carlos Martín Nieto
45d295e08c
git: accept NULL as argument to its stream free
2015-10-30 17:51:50 +01:00
Carlos Martín Nieto
72b7c57093
Merge pull request #3411 from spraints/custom-push-headers
...
Include custom HTTP headers
2015-09-30 09:17:18 +02:00
Matt Burke
d7375662e7
Copy custom_headers insteach of referencing the caller's copy
2015-09-25 10:16:30 -04:00
Matt Burke
d16c1b978f
These can be static
2015-09-24 10:32:29 -04:00
Matt Burke
e60db3c79a
Revise custom header error messages
...
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".
2015-09-24 09:24:10 -04:00
Matt Burke
63cc57232c
Don't null-check
2015-09-24 09:13:05 -04:00
Matt Burke
098f1e6e25
Use an array of forbidden custom headers
2015-09-24 09:09:48 -04:00
Matt Burke
3245896bb7
Add a test for custom header validation
...
Also, *some* custom headers actually are valid.
2015-09-10 13:18:26 -04:00
Matt Burke
66d90e7098
More specific names
2015-09-10 09:14:20 -04:00
Matt Burke
8c876fa91d
Validate custom http headers
2015-09-10 09:11:16 -04:00
Matt Burke
35969c6839
Ignore NULL headers
2015-09-10 08:58:23 -04:00
Carlos Martín Nieto
6c21211c38
Merge pull request #3379 from theseion/additional_libssh2_error_reporting
...
report libssh2 error if list of authentication methods can't be retrieved
2015-09-09 13:59:38 +02:00
Matt Burke
c82c2ba60f
o i
2015-09-08 14:17:59 -04:00
Matt Burke
80ee25434d
Teach winhttp about the extra headers
2015-09-08 14:04:59 -04:00
Matt Burke
276f6aa08d
Hook up the custom_headers to the http transport
2015-09-08 14:02:47 -04:00
Matt Burke
24f5b4e155
Drop extra_http_headers from git_remote
2015-09-08 14:01:57 -04:00
Matt Burke
59d6128e27
Allow the world to set HTTP headers for remotes
2015-09-04 09:36:50 -04:00
Matt Burke
ac9b512789
Pull extra_http_headers from the git_remote
2015-09-04 09:20:45 -04:00
Matt Burke
6af6e69009
Put the extra headers on the connection_data instead
2015-09-04 09:18:32 -04:00
Matt Burke
c3733e5641
Add more headers to HTTP requests
2015-09-04 09:01:30 -04:00
Carlos Martín Nieto
1947592461
Merge pull request #3355 from palmin/palmin/fix-2830
...
Include the 4 characters not recognised as hex-number in parse_len
2015-08-25 00:39:58 +02:00
Carlos Martín Nieto
57af0b928e
cred: add a free function wrapper
2015-08-19 02:23:18 +02:00
Carlos Martín Nieto
47ed7e5acd
transport: provide a way to get the callbacks
...
libgit2 implementations of smart subtransports can simply reach through
the structure, but external implementors cannot.
Add these two functions as a way for the smart subtransports to get the
callbacks as set by the user.
2015-08-19 02:23:18 +02:00
Anders Borum
2d1d2bb59f
Include the 4 characters not recognised as hex-number when setting error in parse_len
2015-08-17 07:58:31 +02:00
Edward Thomson
252f86e1be
Merge pull request #3377 from dleehr/fix-push-cb
...
Fix bug in git_smart__push: push_transfer_progress cb is only called at end
2015-08-15 13:46:32 -07:00
Carlos Martín Nieto
11bca2d265
http: propagate the credentials callback's error code
...
When we ask for credentials, the user may choose to return EUSER to
indicate that an error has happened on its end and it wants to be given
back control.
We must therefore pass that back to the user instead of mentioning that
it was on_headers_complete() that returned an error code. Since we can,
we return the exact error code from the user (other than PASSTHROUGH)
since it doesn't cost anything, though using other error codes aren't
recommended.
2015-08-15 18:15:23 +02:00
Max Leske
241414ee33
added a single line of additional error reporting from libssh2 when failing to retrieve the list of authentication methods
2015-08-14 15:42:59 +02:00
Dan Leehr
b0b2c72274
Fix bug in git_smart__push: push_transfer_progress cb is never called
...
The conditional checked cbs->transfer_progress then used the value in cbs->push_transfer_progress. In both cases it should be push_transfer_progress
2015-08-13 22:52:52 -04:00
Simon
ac728c2483
Handle ssh:// and git:// urls containing a '~' character.
...
For such a path '/~/...' the leading '/' is stripped so the server will
get a path starting with '~' and correctly handle it.
2015-08-03 07:38:07 +01:00
Anders Borum
31a76374a9
case-insensitive check for WWW-Authenticate header
...
Fixes issue #3338
2015-07-29 22:23:00 +02:00
Carlos Martín Nieto
f861abadfe
Merge branch 'portable-zu'
2015-07-12 19:56:19 +02:00