This fixes tons of warnings with clang from a recent xcode version on
macOS (and possibly other systems) complaining that an instantiation
of _singleton is required but no definition is available.
This means that when using SDL 1.2 we use SDL_net 1.2, but when
using SDL 2 we now use SLD_net 2 as well. Both versions work
properly and there is not code change needed in ScummVM.
This change is because SDL_net depends on SDL, and using
SDL_net 1.2 with SDL 2 means we can end up needing to link with
both the SDL and SDL2 libraries.
StorageWizardDialog now runs LocalWebserver in "minimal mode" for
security reasons. In this mode server uses only those handlers which
state to support it.
There are two handlers which support minimal mode: IndexPageHandler
(which handles `code` requests needed by StorageWizardDialog) and
ResourceHandler (which provides inner resources like `style.css` or
`logo.png` from `wwwroot.zip` archive).
It's enabled only when NETWORKING_LOCALWEBSERVER_ENABLE_PORT_OVERRIDE is
defined.
It's not defined, because override means we have to reconfigure our
redirect links somehow to use the override port.
That means that if current buffer is over, reader will stop reading and
it's safe to call readResponse() again, so it would continue from the
place it left.
That should be part of the Client, I guess. Reader is not ready to
continue reading from place it stopped, but it already works as it
should for the case when whole content is available.
It does redirect to "/files" on success, so user doesn't even see the
strange "/create" URL at all.
This commit is for keeping these handlers small, not making one
(FilesPageHandler in this case) do everything.
Its handlers are now more compact. This commit moves Handler classes in
handlers\ directory.
ResourceHandler ignores "hidden" files in the archive, and these are
used as markup templates in IndexPageHandler and FilesPageHandler.
That ClientHandler is made for responding GET requests. It calculates
stream's length, it allows to specify response code and headers, it can
be used to transfer any ReadStream.