src/netops.c


Log

Author Commit Date CI Message
Carlos Martín Nieto 65ca81a6 2012-05-08T14:28:21 Minor error fixes Clear the error in pkt when we notice that the remote is starting to send the packfile. Fix the format string for Windows networking errors.
Scott J. Goldman 901fbdad 2012-05-07T00:05:02 Define explicit _WIN32_WINNT version in makefile Previously, it was defined in netops.c, but it's also needed in one of the clar tests, so I figured we might as well just make it global for the whole project. Without it, the mingw32 linker won't resolve GetProcessId() (called from the core/errors.c clar test) because of some conditionals in windows.h.
Vicent Martí cd58c15c 2012-05-05T16:47:20 Merge remote-tracking branch 'scottjg/fix-mingw32' into development Conflicts: src/netops.c src/netops.h src/transports/http.c tests-clar/clar
Scott J. Goldman b4b96d56 2012-05-05T13:30:33 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.
Russell Belfer 44ef8b1b 2012-04-13T13:00:10 Fix warnings on 64-bit windows builds This fixes all the warnings on win64 except those in deps, which come from the regex code.
Carlos Martín Nieto bd6585a7 2012-03-16T15:15:21 netops: show winsock error messages on Windows
Carlos Martín Nieto 56b7df10 2012-03-07T07:01:20 error-handling: netops
schu 5e0de328 2012-02-13T17:10:24 Update Copyright header Signed-off-by: schu <schu-github@schulog.org>
Ehsan Akhgari 31ffc141 2012-02-02T00:14:59 Fix the build on Emscripten struct timeval is used in this file, which requires <sys/time.h> to be included.
Vicent Marti 3286c408 2011-10-28T14:51:13 global: Properly use `git__` memory wrappers Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
Carlos Martín Nieto 51760bc1 2011-10-05T18:11:22 pkt: get rid of the chunked support It was a bad idea. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto f9613325 2011-10-05T00:42:27 http: parse the response from the server Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 34bfb4b0 2011-09-14T00:54:45 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>
Carlos Martín Nieto 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>
Carlos Martín Nieto 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>
Vicent Marti 6e34111e 2011-09-29T16:30:38 netops: Use pragmas only in MSVC
Vicent Martí 8114ee4c 2011-09-22T10:17:43 Merge pull request #405 from carlosmn/http-ls Implement ls-remote over HTTP
Vicent Marti 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.
Carlos Martín Nieto 928dd90a 2011-09-09T13:17:58 netops: store the error if gitno_send fails Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 24384700 2011-09-06T21:44:13 netops: don't try to free addrinfo on DNS error Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto b0bda0a4 2011-09-07T19:13:40 netops: get rid of the len - 1 limitation This was as a result of the pkt code using string functions where they shouldn't. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
Carlos Martín Nieto 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>
Vicent Marti 0bd594b6 2011-08-30T19:44:09 netops: Use the size_t, Luke
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>
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 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 ea7a5452 2011-06-24T16:25:26 Add gitno_buffer as a recv wrapper 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 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>