- Rename zfstream.cxx (resp. zfstream.hxx) to gzfstream.cxx (resp.
gzfstream.hxx)
This is because these files only deal with the gzip format (RFC 1952),
while zlib can actually read and write two slightly different formats:
this one and the "ZLIB Compressed Data Format" (RFC 1950). Since I am
going to add std::streambuf and std::istream subclasses able to deal
with both formats (and supporting data sources that are general
std::istream instances, not just files), this renaming will make
things a bit clearer, I hope.
- Add new folder simgear/io/iostreams and move the following files to
this folder:
simgear/misc/gzcontainerfile.cxx
simgear/misc/gzcontainerfile.hxx
simgear/misc/gzfstream.cxx
simgear/misc/gzfstream.hxx
simgear/misc/sgstream.cxx
simgear/misc/sgstream.hxx
simgear/misc/sgstream_test.cxx
- Adapt other files accordingly (mainly #includes and CMakeLists.txt
files).
HTTP/1.0 and HTTP/1.1 allow the reason string to be empty.
Some servers produce empty reason strings on success,
e.g. "HTTP/1.1 200 ", which throws a "bad HTTP response"
exception.
From the specification:
"Reason-Phrase = *<TEXT, excluding CR, LF>"
From notational conventions:
"*(element) allows any number, including zero"
References:
www.w3.org/Protocols/rfc2616/rfc2616-sec2.html#sec2
www.w3.org/Protocols/HTTP/1.0/spec.html
www.w3.org/Protocols/rfc2616/rfc2616-sec6.html
- Create "testfile" in a temporary directory (and make sure the temp dir
and the file it contains are both removed when the test program exits).
- Use test macros such as SG_CHECK_EQUAL() instead of by-hand checks and
"return EXIT_FAILURE" statements.
- Use sg_ofstream instead of plain std::ostream. This simplifies things
a tiny bit, because one SGPath instance is enough to create both the
sg_ofstream instance and the sg_gzifstream instance used afterwards to
reread the created file.
- Don't call (sg_)ofstream::close() at the end of the block the instance
is declared in: this is entirely unnecessary, since sg_ofstream
derives from std::ofstream, which is automatically close()d when
destroyed (RAII behavior).
- Add method simgear::Dir::isNull(), analogous to SGPath::isNull().
- Make sure that simgear::Dir::tempDir() returns a null simgear::Dir
instance when creation of the directory failed (so far, this was only
the case on systems where HAVE_MKDTEMP is defined).
- Use simgear::strutils::error_string() instead of strerror() (the
latter is not guaranteed to be thread-safe).
- Make sure <cerrno> is #included, regardless of the platform.
- Add automated tests for isNull(), setRemoveOnDestroy() and tempDir().
This was triggered by the TU154B; probably related to the console error
* "Image loading failed:Warning: reading "fgdata\AI\Aircraft\tu154b\Model" not supported.
This avoids an XML naming clash, and allows both systems to exist in
parallel peacefully. Update the tests to check both the thumbnails
and preview system in parallel with each other.
In pt_lights.cxx in SGLightFactory::getOdal, at segment "centerline lights",
the decrement loop index i is initialized with lights.getNumLights(), then is used at lights.getLight. (ERROR)
The function getNumLights is set to the size of the vector which is one more than the max index refernce.
This restores the behavior that was in place before commit 8ddb99f62f