Commit Graph

29 Commits

Author SHA1 Message Date
Ben Straub
cf7038a65c Enhance url parsing to include passwords 2013-01-31 14:04:21 -08:00
Ben Straub
2234b2b031 Stash username from url (but don't use it yet) 2013-01-30 19:03:58 -08:00
Edward Thomson
359fc2d241 update copyrights 2013-01-08 17:31:27 -06:00
Philip Kelley
41fb1ca0ec Reorganize transport architecture (squashed 3) 2012-11-01 09:02:33 -04:00
Ben Straub
7bcd9e23e8 gitno_buffer: callback on each packet
The fetch code takes advantage of this to implement a
progress callback every 100kb of transfer.
2012-10-19 19:36:23 -07:00
Vicent Marti
e25dda51c4 Merge remote-tracking branch 'nulltoken/topic/amd64-compat' into development
Conflicts:
	src/netops.c
	src/netops.h
	src/oid.c
2012-08-02 01:38:30 +02:00
Carlos Martín Nieto
b49c8f71ae remote: use the same code to control git and http
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).
2012-07-30 20:28:16 +02:00
Carlos Martín Nieto
64d01de8a7 remote: start moving the protocol to a common area
For the transition, http is going to keep its own logic until the
git/common code catches up with the implied multi_ack that http
has. This also has the side-effect of making the code cleaner and more
correct regardingt he protocol.
2012-07-30 20:25:10 +02:00
nulltoken
b8457baae2 portability: Improve x86/amd64 compatibility 2012-07-24 16:10:12 +02:00
Carlos Martín Nieto
89460f3f57 ssl: teardown the connection on close
This should help us free some resources, though the libraries do keep
some buffers allocated regardless.
2012-05-19 17:50:52 +02:00
Carlos Martín Nieto
a6f24a5b3a https: make it work with OpenSSL as well
Add specific functions that use OpenSSL instead of GnuTLS
2012-05-19 17:50:52 +02:00
Carlos Martín Nieto
66024c7cbc http: add https support when GnuTLS is available
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.
2012-05-19 17:50:52 +02:00
Vicent Martí
cd58c15c58 Merge remote-tracking branch 'scottjg/fix-mingw32' into development
Conflicts:
	src/netops.c
	src/netops.h
	src/transports/http.c
	tests-clar/clar
2012-05-05 16:47:20 -07:00
Scott J. Goldman
b4b96d56bf Fix gitno_connect() error handling on Windows
gitno_connect() can return an error or socket, which is fine on most
platforms where sockets are file descriptors (signed int), but on Windows,
SOCKET is an unsigned type, which is problematic when we are trying to
test if the socket was actually a negative error code.

This fix seperates the error code and socket in gitno_connect(), and fixes
the error handling in do_connect() functions to compensate. It appears
that git_connect() and the git-transport do_connect() functions had bugs
in the non-windows cases too (leaking sockets, and not properly reporting
connection error, respectively) so I went ahead and fixed those too.
2012-05-05 13:33:46 -07:00
Russell Belfer
44ef8b1b30 Fix warnings on 64-bit windows builds
This fixes all the warnings on win64 except those in deps, which
come from the regex code.
2012-04-17 10:47:39 -07:00
schu
5e0de32818 Update Copyright header
Signed-off-by: schu <schu-github@schulog.org>
2012-02-13 17:11:09 +01:00
Carlos Martín Nieto
34bfb4b0d4 net,pkt: add chunked support
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>
2011-10-12 21:33:18 +02:00
Carlos Martín Nieto
bad53552e5 netops: abstract away socket closing
Winsock wants us to use closesocket() instead of close(), so introduce
the gitno_close function, which does the right thing.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 00:41:09 +02:00
Carlos Martín Nieto
ccc9872d4d Initialise the winsock DLL
Windows wants us to initialise the networking DLL before we're allowed
to send data through a socket. Call WSASetup and WSACleanup if
GIT_WIN32 is defined.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-10-01 00:41:08 +02:00
Vicent Martí
8114ee4c95 Merge pull request #405 from carlosmn/http-ls
Implement ls-remote over HTTP
2011-09-22 10:17:43 -07:00
Vicent Marti
bb742ede3d Cleanup legal data
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.
2011-09-19 01:54:32 +03:00
Carlos Martín Nieto
db84b7988b Move extract_host_and_port to netops and add default port argument
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-09-04 16:07:52 +02:00
Vicent Marti
92e34fa6d6 netops: This is the proper check 2011-08-30 19:48:13 +02:00
Vicent Marti
0bd594b61c netops: Use the size_t, Luke 2011-08-30 19:44:09 +02:00
Carlos Martín Nieto
74bd343ae8 Fix Windows compilation
Sockets on Windows are unsigned, so define a type GIT_SOCKET which is
signed or unsigned depending on the platform.

Thanks to Em for his patience with this.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-08-30 19:37:14 +02:00
Carlos Martín Nieto
c7c787ce0c Use gitno_buffer in the git transport
This allows us to leave out the buffer handling logic.

Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-06-27 02:09:49 +02:00
Carlos Martín Nieto
ea7a5452f4 Add gitno_buffer as a recv wrapper
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-06-27 02:09:49 +02:00
Carlos Martín Nieto
4e95ef0268 Implement and use gitno_send 2011-06-26 20:43:44 +02:00
Carlos Martín Nieto
1b4f814025 Create netops and start moving git:// to it
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
2011-06-26 20:43:44 +02:00