|
7ad994bb
|
2011-10-01T13:41:16
|
|
transport-git: fix git request length calculation
There was an off-by-one error that was uncovered when we used the
right length from git_buf.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
10063aeb
|
2011-10-01T13:10:29
|
|
transport-git: Encapsulation ist gut
|
|
bad53552
|
2011-09-30T23:48:27
|
|
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>
|
|
ccc9872d
|
2011-09-30T17:21:30
|
|
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>
|
|
a95aeb48
|
2011-09-30T16:55:05
|
|
Use git_buf in the git request
This is clearer and sidesteps the issue of what the return value of
snprintf is on the particular OS we're running on.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
8114ee4c
|
2011-09-22T10:17:43
|
|
Merge pull request #405 from carlosmn/http-ls
Implement ls-remote over HTTP
|
|
87d9869f
|
2011-09-19T03:34:49
|
|
Tabify everything
There were quite a few places were spaces were being used instead of
tabs. Try to catch them all. This should hopefully not break anything.
Except for `git blame`. Oh well.
|
|
bb742ede
|
2011-09-19T01:54:32
|
|
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.
|
|
db84b798
|
2011-09-04T15:32:11
|
|
Move extract_host_and_port to netops and add default port argument
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
74bd343a
|
2011-08-19T09:03:19
|
|
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>
|
|
3ef7d063
|
2011-08-30T13:10:26
|
|
network: <select.h> is not available in MinGW
|
|
aa2f68d8
|
2011-08-30T03:39:28
|
|
Merge pull request #378 from kiryl/Wuninitialized
Wuninitialized
|
|
932669b8
|
2011-08-25T14:22:57
|
|
Drop STRLEN() macros
There is no need in STRLEN macros. Compilers can do this trivial
optimization on its own.
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
c75a890b
|
2011-08-24T20:11:15
|
|
transport_git: add missed error handling
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
|
|
7adba5f4
|
2011-08-13T20:18:29
|
|
Keep sending want lines if the server doesn't anwer a flush
Some servers take a long time to answer and expect us to keep sending
want lines; otherwise they close the connection. Avoid this by waiting
for one second for the server to answer. If the timeout runs out,
treat is as a NAK and keep sending want lines.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
427ca3d3
|
2011-08-12T22:44:35
|
|
Actually implement object negotiation
Only signal that we need a pack if we do need it and don't send a want
just because it's the first. If we don't need to download the pack,
then we can skip all of the negotiation and just return success.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
22f65b9e
|
2011-08-10T20:49:43
|
|
Move negotiation to the transport
There are many ways how a transport might negotiate with the server,
so instead of making it fit into the smart protocol model, let the
transport do its thing. For now, the git protocol limits itself to
send only 160 "have" lines so we don't flood the server.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
7284c105
|
2011-08-07T10:23:53
|
|
Don't try to download the packfile too early
Make sure we only try to download the pack if we find the pack header
in the stream, and not if the server takes a bit longer to send us the
last NAK.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
2f512ff8
|
2011-08-05T18:11:30
|
|
Use strcpy+strcat as memcpy was overlapping
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
0437d991
|
2011-08-05T15:45:05
|
|
Use common capabilities
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
48a65a07
|
2011-08-04T22:42:58
|
|
Only wait for pack if we need it
Provide the git_remote_download function to instruct the library to
downlad the packfile and let the user know the temporary location.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
9cf0f287
|
2011-08-04T17:50:50
|
|
Tell the user where the downloaded packfile is stored
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
da290220
|
2011-07-31T02:40:43
|
|
Download pack
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
7e1a94db
|
2011-07-31T01:16:47
|
|
Move have sending
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
b4c90630
|
2011-07-30T22:29:00
|
|
Implement sending haves
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
0e20ba60
|
2011-07-30T18:56:20
|
|
Add a generic send_wants
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
bdd18829
|
2011-07-11T02:58:00
|
|
Cleanup external API
Some of the WIP API calls have been hidden in preparation for the next
minor release.
|
|
39cdf272
|
2011-07-06T09:11:03
|
|
Fix network MSYS compilation
MSYS/MinGW uses winsock but obviously doesn't set _MSC_VER. Use _WIN32
to decide whether to use winsock or BSD headers. Also remove these
headers from src/transport_git.c altogether, as they are not needed.
MSYS is very conservative, so we have to tell it that we don't care
about versions of Windows lower than WindowsXP. We also need to tell
CMake to add ws2_32 to the libraries list and we shouldn't add the
-fPIC option, to MSYS because it complains that it does it anyway.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
0ac2726f
|
2011-06-27T20:23:47
|
|
Slim down git_transport
Remove the unused repo and private pointers and make the direction a
flag, as it can only have two states. Change the connect signature to
use an int instead of git_net_direction and remove that enum.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
5da5321d
|
2011-06-27T20:01:57
|
|
Initialize memory in git transport
At the same time, do mark the transport as connected.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
c7c787ce
|
2011-06-24T18:19:00
|
|
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>
|
|
4e913309
|
2011-06-17T16:38:21
|
|
Move transports to an inheritance model
Rather than an 'private' pointer, make the private structures inherit
from the generic git_transport struct. This way, we only have to worry
about one memory allocation instead of two. The structures are so
simple that this may even make the code use less memory overall.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
fd679021
|
2011-06-16T02:17:49
|
|
Move git_pkt_{gen_proto,send_request} to transport_git.c
This is where they really belong. Remvoe the prefix and make them
static.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
c4d0fa85
|
2011-06-16T01:54:19
|
|
Implement and use git_pkt_send_request
This makes it easier to send a requqest for an URL. It assumes there
is a socket where the string should go out to.
Make git_pkt_gen_proto accept a command parameter, which defaults to
git-upload-pack
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
4e95ef02
|
2011-06-16T00:59:46
|
|
Implement and use gitno_send
|
|
1b4f8140
|
2011-06-16T00:39:35
|
|
Create netops and start moving git:// to it
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
7632e249
|
2011-06-13T23:01:12
|
|
Correctly handle network input
Add a parameter to git_pkt_parse_line to tell it how much data you
have in your buffer. If the buffer is too short, it returns an error
saying so. Adapt the git transport to use this and fix the offset
calculation.
Add the GIT_ESHORTBUFFER error code.
|
|
be9fe679
|
2011-06-08T23:38:22
|
|
Implement and use git_pkt_free
A git_pkt object can be one of several structs. Add this function for
convenience and clarity.
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|
|
ecb6ca0e
|
2011-06-08T13:09:47
|
|
Implement the git TCP transport up to ls-remote
Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
|