src/transport_git.c


Log

Author Commit Date CI Message
Carlos Martín Nieto 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>
Vicent Marti 3ef7d063 2011-08-30T13:10:26 network: <select.h> is not available in MinGW
Vicent Martí aa2f68d8 2011-08-30T03:39:28 Merge pull request #378 from kiryl/Wuninitialized Wuninitialized
Kirill A. Shutemov 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>
Kirill A. Shutemov c75a890b 2011-08-24T20:11:15 transport_git: add missed error handling Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 2f512ff8 2011-08-05T18:11:30 Use strcpy+strcat as memcpy was overlapping Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 0437d991 2011-08-05T15:45:05 Use common capabilities Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto da290220 2011-07-31T02:40:43 Download pack Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 7e1a94db 2011-07-31T01:16:47 Move have sending Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto b4c90630 2011-07-30T22:29:00 Implement sending haves Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 0e20ba60 2011-07-30T18:56:20 Add a generic send_wants Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Vicent Marti 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.
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 4e95ef02 2011-06-16T00:59:46 Implement and use gitno_send
Carlos Martín Nieto 1b4f8140 2011-06-16T00:39:35 Create netops and start moving git:// to it Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 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.
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>