summaryrefslogtreecommitdiff
path: root/src/network/core/tcp_http.cpp
AgeCommit message (Collapse)Author
2021-06-15Codechange: [Network] Simplify constructing the HTTP request with fmtrubidium42
2021-06-13Codechange: convert printf DEBUG statements to fmt Debug statementsrubidium42
2021-05-13Codechange: [Network] split CloseSocket and CloseConnection more clearly (#9261)Patric Stout
* Codechange: [Network] split CloseSocket and CloseConnection more clearly - CloseSocket now closes the actual OS socket. - CloseConnection frees up the resources to just before CloseSocket. - dtors call CloseSocket / CloseConnection where needed.
2021-05-12Change: reworked the debug levels for network facility (#9251)Patric Stout
It now follows very simple rules: 0 - Fatal, user should know about this 1 - Error, but we are recovering 2 - Warning, wrong but okay if you don't know 3 - Info, information you might care about 4 - 5 - Debug #1 - High level debug messages 6 - Debug #2 - Low level debug messages 7 - Trace information
2021-05-06Feature: use Happy Eyeballs to make network connections (TCP-only) (#9199)Patric Stout
Hostnames like "content.openttd.org" resolve into multiple IPv4 and IPv6. It is possible that either of the IPs is not working, either due to a poorly configured OS (having IPv6 but no valid route), broken network paths, or a service that is temporary unavailable. Instead of trying the IPs one by one, waiting for a 3s timeout between each, be a bit more like browsers, and stack attempts on top of each other with slight delays. This is called Happy Eyebells. Initially, try the first IPv6 address. If within 250ms there is no connection yet, try the first IPv4 address. 250ms later, try the second IPv6 address, etc, till all addresses are tried. If any connection is created, abort all the other (pending) connections and use the one that is created. If all fail 3s after the last connect(), trigger a timeout for all.
2021-05-05Codechange: use connection_string in favour of NetworkAddress (#9197)Patric Stout
We now resolve the connection_string to a NetworkAddress in a much later state. This means there are fewer places constructing a NetworkAddress. The main benefit of this is in later PRs that introduce different types of NetworkAddresses. Storing this in things like NetworkGameList is rather complex, especially as NetworkAddress has to be mutable at all times. Additionally, the NetworkAddress is a complex object to store simple information: how to connect to this server.
2021-05-01Codechange: encapsulate network error handlingrubidium42
2021-04-29Change: [Network] Encapsulate logic about the connection string to the ↵rubidium42
network code (#23)
2021-04-29Codechange: use NetworkAddress instead of two host/port variables where possiblePatric Stout
This also means we no longer need last_host/last_port, but can just use a single last_joined setting.
2021-04-27Codechange: move all NetworkGameInfo related functions to a single filePatric Stout
It currently was a bit scattered over the place. Part of NetworkGameInfo is also the GRF Identifiers that goes with it.
2021-04-27Change: [Network] Use string error messages instead of numeric error numbers ↵rubidium42
that need to be looked up
2021-04-27Fix: [Network] errno and strerror do not handle network errors on Windowsrubidium42
2021-04-20Codechange: split ParseConnectionString into two functionsPatric Stout
One also looks for a company, the other doesn't. There were more uses of the latter than the first, leaving very weird code all over the place.
2021-01-08Codechange: Remove min/max functions in favour of STL variants (#8502)Charles Pigott
2019-11-10Cleanup: Removed SVN headersS. D. Cloudt
2019-04-10Codechange: Use null pointer literal instead of the NULL macroHenry Wilson
2019-03-26Codechange: Removed SmallVector completelyHenry Wilson
2019-03-26Codechange: Replaced SmallVector::[Begin|End]() with std alternativesHenry Wilson
2019-03-26Codechange: Replaced SmallVector::Append() with ↵Henry Wilson
std::vector::[push|emplace]_back()
2019-03-26Codechange: Replaced SmallVector::Erase() with std::vector::erase()Henry Wilson
2019-03-26Codechange: Replace SmallVector::Length() with std::vector::size()Henry Wilson
2019-03-20Remove: ENABLE_NETWORK switchPatric Stout
This switch has been a pain for years. Often disabling broke compilation, as no developer compiles OpenTTD without, neither do any of our official binaries. Additionaly, it has grown so hugely in our codebase, that it clearly shows that the current solution was a poor one. 350+ instances of "#ifdef ENABLE_NETWORK" were in the code, of which only ~30 in the networking code itself. The rest were all around the code to do the right thing, from GUI to NewGRF. A more proper solution would be to stub all the functions, and make sure the rest of the code can simply assume network is available. This was also partially done, and most variables were correct if networking was disabled. Despite that, often the #ifdefs were still used. With the recent removal of DOS, there is also no platform anymore which we support where networking isn't working out-of-the-box. All in all, it is time to remove the ENABLE_NETWORK switch. No replacement is planned, but if you feel we really need this option, we welcome any Pull Request which implements this in a way that doesn't crawl through the code like this diff shows we used to.
2019-03-05Remove: MorphOS / AmigaOS supportPatric Stout
In 10 years there is no commit to change how MorphOS works, and we have no active maintainer for it. It is unlikely it works in its current state (but not impossible). With the arrival of SDL2 (and removal of SDL), MorphOS is no longer support. There is an SDL2 port for MorphOS, but it is not maintained by upstream SDL2, and nobody can currently test it out. If anyone wants to re-add MorphOS, please do (revert this patch, fix the problems, and create a Pull Request). If you need any help doing so, let us know! It is not that we don't like MorphOS, it is that we don't have anyone fixing the problems :(
2019-02-03Change: Make a shortened network revision string for use in server queriesNiels Martin Hansen
2014-04-23(svn r26482) -Codechange: add an include that allows us to undefine/redefine ↵rubidium
"unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values
2013-01-08(svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by ↵planetmaker
Eagle_rainbow)
2011-11-12(svn r23198) -Codechange: introduce a free that takes const pointers so we ↵rubidium
don't need to cast to void/non-const before being able to free
2011-05-01(svn r22403) -Document: some more network/core coderubidium
2011-01-22(svn r21886) -Codechange: move documentation towards the code to make it ↵rubidium
more likely to be updated [n].
2010-11-23(svn r21302) -Fix (r18994): do not add HTTP connection to list of ↵smatz
connections when it fails in the beginning
2010-08-26(svn r20632) -Cleanup: remove "a few" unneeded includes, and add them to ↵rubidium
some headers
2010-07-31(svn r20266) -Doc: Mostly typo fixes, a few doxygen-related improvements.alberth
2010-02-10(svn r19090) -Codechange: some comment coding style fixesrubidium
2010-02-03(svn r18996) -Fix (r18993, r18994): MSVC 64 bits had somethings to complain ↵rubidium
about
2010-02-03(svn r18994) -Change: content mirroring support (based on work by TrueBrain).rubidium