Commit Graph

20 Commits

Author SHA1 Message Date
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