Commit Graph

8032 Commits

Author SHA1 Message Date
Adrien Destugues 70f91e39aa Remove preprocessor checks from TestShell.h
* This is a header used by several parts of the code which should not
need to know about ELF symbol overriding and the fact that it is
optional.
* When the define is set, the methods will not be defined, but they
shouldn't be called, either
* This makes sure the memory layout of the class stays the same with the
define set or unset, and users can rely on it.

Fixes UnitTester on gcc2.
2014-07-29 23:05:52 +02:00
Adrien Destugues a1cce97050 HttpRequest: more small fixes and cleanups
* Remove unneeded field fOutputHeaders and convert it to a local for the
only method that uses it,
* Don't return EOVERFLOW when flushing data from ZLib (the ZLib
decompressor returns this, but zlib docs states that this is NOT an
error condition).
* Replace unneeded temporary BNetBuffer of fixed size with BStackOrHeapArray.
2014-07-28 15:02:17 +02:00
Adrien Destugues 548149fe48 Fix out-of-date comment. 2014-07-28 15:02:15 +02:00
Adrien Destugues 021ebc2f8c Add the port to the HTTP Host header when needed.
* When the port is not the default one, it must be added to the "Host"
header so the server knows what we're connecting to.

Fixes #11070.
2014-07-28 15:02:13 +02:00
François Revol 0c1a4ebf8b Preliminary support for Gopher
Currently parses information and text items and retrives files.
2014-07-26 01:42:36 +02:00
John Scipione d11a323120 TextView: Fix FBC size breakage, take 2
Double checked BeOS R5 & Haiku R1/A4 and BTextView should be 356
bytes, somewhere since then we've added 4 bytes. So, this commit
reduces the class size from 360 back to 356 by removing 1 reserved
int32 (instead of 2).

I believe the class size changed in hrev46798 as a result of adding
2 bools (1 byte each padded out to 4 bytes).

Sorry for the noise.
2014-07-24 13:55:09 -04:00
John Scipione fb224a9f14 Revert "TextView: Fix FBC size breakage"
This reverts commit 8e268f7552.
2014-07-24 13:15:30 -04:00
John Scipione 8e268f7552 TextView: Fix FBC size breakage
In hrev46796 I added two new private methods: _PreviousLineStart(),
and _NextLineEnd() which increased the size of the class breaking
binary compatability because I forgot to decrement the reserved array.

This commit decrements the reserved array restoring the class size
to the original size fixing the binary compat issue.

Thanks Axel for noticing.
2014-07-24 10:29:06 -04:00
John Scipione fef862eb20 TextView.h rearrage virtual methods for FBC
The order is updated so the virtual methods appear in the same order
that they did in BeOS R5 with methods new to Haiku added to the bottom.

Perform() moves up, all other methods move below GetDragParameters(),
the last virtual method in BeOS R5's TextView.h.
2014-07-24 10:29:04 -04:00
François Revol 0be89c15ee tty: Add bitmask ioctls TIOCMBIS and TIOCMBIC
Equivalent to TIOCMSET + bitmask + TIOCMGET but with a single call.

Gnokii uses that.
2014-07-23 21:36:07 +02:00
François Revol c8826605df Guard header for use by assembler code
Somehow it ends up being used by shell.S for the verdex bootstrap.
2014-07-23 13:27:23 +02:00
Adrien Destugues 9f7d29b05e Fix two problems with chunked gzipped HTTP replies.
* receiveEnd is set in a different place in case of chunked transfers,
which would cause the decompressor to never be flushed.
* In the case of chunked transfers, we call Flush() without any input
data (to flush only whatever is remaining in the decompression buffer).
This causes ZLib to return Z_BUF_ERROR which is translated to
B_BUFFER_OVERFLOW. This is a non-fatal error and is expected behavior in
that case. Don't handle this as an error, and do use the extracted data.

Fixes various cases of missing the last chunk of a page (pastie.org,
Google search results, and more).
2014-07-21 11:49:42 +02:00
John Scipione e8c8f8536c Storage Kit: Style fixes to database_support.h 2014-07-17 14:51:31 -04:00
John Scipione 24588f6b80 BShape: Rename these params back in header.
Accidentally renamed these in the header, rename them back to
match the cpp file. These param names might not be very good but
they match the struct variable names. They are private methods
anyway. No functional change intended in either commit.
2014-07-14 19:15:13 -04:00
John Scipione db1ef05aef BShape: Style fixes for docs 2014-07-14 19:02:44 -04:00
Ingo Weinhold e1e6c12480 BPackageWriter::Recompress(): Change param to BPositionIO*
Besides that this is a nicer interface, it allows us to get a the HPKG
header as a side effect of initializing the reader, thus preventing
seeking backward in the file. This makes "package recompress - <file>"
work.
2014-07-13 17:57:57 +02:00
Ingo Weinhold 43a6b92c64 PackageReaderImpl: Delay reading sections until ParseContent() 2014-07-13 17:57:56 +02:00
Ingo Weinhold 1606450b32 ReaderImplBase::Init(): Make file size check optional
If the file doesn't support GetSize(), skip the header total size file
size check.
2014-07-13 17:57:56 +02:00
Ingo Weinhold 05b565f4f2 Add private BDataPositionIOWrapper
Implements the BPositionIO interface on top of a BDataIO, requiring the
{Read,Write}At() accesses to be sequential.
2014-07-13 17:57:56 +02:00
Ingo Weinhold 44c4771163 BPackageWriter: Add BPositionIO support 2014-07-13 17:57:55 +02:00
Julian Harnath b916156a83 Move libroot synchronization functions to private namespace
* Prefix lock functions with __ to mark them as private. Add
  forwarding macros to keep existing code working.

* Avoids symbol name clashes with kernel lock APIs, occuring when
  using kernellandemu-lib in userlandfs. Thanks to Ingo for the
  suggestion.
2014-07-13 16:19:08 +02:00
Julian Harnath 2e75b75292 Fix building Haiku from Haiku
* Always include cdefs.h to have __[BEGIN|END]_DECLS defined.
  Somehow, this didn't affect cross-build, but it made building
  from Haiku fail.
2014-07-13 15:35:31 +02:00
Ingo Weinhold 8f5130edfa package kit: Actually add support for B_HPKG_COMPRESSION_NONE
Until now we always declared in the HPKG header that the package file is
zlib compressed. For uncompressed files we would just store all
individual chunks uncompressed. Now we handle completely uncompressed
files slightly differently: We don't write the redundant chunk size
table anymore. The size savings are minor, but it makes the uncompressed
format read-streamable which may be handy.
2014-07-12 23:12:21 +02:00
Ingo Weinhold e527b79631 Switch package file accessor classes to use BPositionIO
* PackageFileHeap{Reader,Writer} as well as Package{Reader,Writer} and
  their implementation and super classes do now internally use a
  BPositionIO instead of a FD to access the package file. This provides
  more flexibility needed for features to come.
* BPackageReader has already grown a new Init() version with a
  BPositionIO* parameter.
2014-07-12 15:40:22 +02:00
Ingo Weinhold c55a06055f Add private class BFdIO
Simple BPositionIO implementation using the POSIX API on a FD. In effect
similar to BFile, but more easily ported to kernel and boot loader (and
the FD is reusable).
2014-07-12 15:40:21 +02:00
Ingo Weinhold 8546c4160e BPositionIO: Add {Read,Write}AtExactly()
Analoguous to {Read,Write}Exactly(), just for the *At() versions.
2014-07-12 15:40:21 +02:00
Jérôme Duval 74e1a530f8 Revert unrelated part of 17aa359b5d. 2014-07-11 22:23:21 +02:00
Akshay Jaggi 17aa359b5d XHCI USB: Fixes.
* Add support for hubs in AllocateDevice().
* Prevent page fault in FinishTransfers().
* Set fCapabilityLength
* Correct in BIOS ownership code
* Fix context errors in _InsertEndpointForPipe().
* Update constants according to latest Specification (v1.1)
* Fix SMI code (reference
http://lkml.iu.edu/hypermail/linux/kernel/1204.2/02460.html).
* Fix Memory/Device-Slot leaks.
* Fix area allocation for TRBs.
* Fix for Intel Lynx Point and Panther Point chipsets. Also move init
of xhci before ehci, to switch USB 2.0 ports before the ehci module
discovers them.

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
2014-07-11 22:14:05 +02:00
Axel Dörfler de9c061339 bfs: Use the QueryParserUtils instead of its own copy.
* Ingo copied the methods into a shared location, and then obviously
  "forgot" to let BFS use them. As a side note for Ingo: the complete
  error GCC reported was "std::fssh_size_t" not defined with the macro
  wrapper as code location. The actual problem was a "using std::size_t"
  in some C++ header that accidentally got included after the wrapper.
* The shared Query code is not yet used. That'll be done another time.
* Renamed BFS_SHELL define to FS_SHELL, such that QueryParserUtils can be
  used in any file system shell, not just the bfs_shell.
2014-07-09 22:54:39 +02:00
Ingo Weinhold cdfeba5a1e BPackageWriter: Add Recompress()
Allows rewriting an existing package file with a different compression.
2014-07-08 22:00:35 +02:00
Ingo Weinhold a5330a8e41 Remove private support kit BUrl
Use the public BUrl from the network kit instead.
2014-07-03 17:39:59 +02:00
Ingo Weinhold 72f6b787cf BUrl: Add missing functionality from support kit BUrl 2014-07-03 17:39:59 +02:00
Ingo Weinhold 6926863e37 DynamicBuffer::Write(): Fix return type and semantics 2014-07-03 17:39:58 +02:00
Ingo Weinhold 7616c39db6 DynamicBuffer: dos2unix 2014-07-03 17:39:57 +02:00
Ingo Weinhold 739f15e144 Revert "Revert "DynamicBuffer: implement BDataIO""
This reverts commit 747b401e87.
2014-07-03 17:39:57 +02:00
Ingo Weinhold 72cf56a0fd BZlibCompressionAlgorithm: Basic support for gzip format 2014-07-01 21:54:58 +02:00
Ingo Weinhold b3263ad3e1 Switch package kit to BZlibCompressionAlgorithm
... and remove the Zlib{Compressor,Decompressor} API.
2014-06-30 21:55:41 +02:00
Ingo Weinhold dcdc33b0af Add B[Zlib]CompressionAlgorithm
* BCompressionAlgorithm is a base class for classes that provide
  compression/decompression functionality. There are methods for
  compressing/decompressing a single buffer and factory methods for
  a compressing/decompressing input/output BDataIO.
* BZlibCompressionAlgorithm is a BCompressionAlgorithm implementation
  using zlib.
2014-06-30 21:55:41 +02:00
Ingo Weinhold 6a89a36aa0 Move package kit Zlib* classes to support kit
Also move to B* namespace and no longer expose the zlib dependency in
the headers.
2014-06-30 21:55:41 +02:00
Ingo Weinhold b773d89eba BDataIO: Add Flush() 2014-06-30 21:55:40 +02:00
Ingo Weinhold 0dab9e5cb4 package kit: ReaderImplBase: Remove superfluous scratch buffer 2014-06-30 21:51:16 +02:00
Ingo Weinhold 0a62e01902 PackageWriterImpl: Remove superfluous method 2014-06-30 21:51:16 +02:00
Adrien Destugues eef22dfb75 Revert "Remove haiku_host/Errors.h"
This reverts commit f105756e27.

The host header gets included if this file is missing , rather than the
one in the build tree. Fix the build again.
2014-06-26 08:01:00 +02:00
John Scipione 732c579702 Roster: style fixes.
* Check if == NULL or == 0 explicitily
* Use NULL instead of 0 as default value for pointers in header.
* other little stuff, new lines, comments
2014-06-25 19:31:24 -04:00
Adrien Destugues f105756e27 Remove haiku_host/Errors.h
The only purpose of this was to use the installed version of Errors.h,
which isn't strictly needed and create some annoyance when new error
codes are added.
2014-06-25 23:01:13 +02:00
John Scipione e0016ffde9 Style fixes to BRoster, move docs to doxygen.
Keep the brief description as a regular comment above each public method.

Leave the docs of private methods.

Some variable renaming mostly because of abbreviations.

Add documentation for all the public methods and app_info members and defines
that didn't have docs in the cpp file.
2014-06-25 15:35:09 -04:00
Adrien Destugues 158ae74373 Escape reserved characters when converting paths to urls
* Introduce and use BUrl::BUrl(const BPath&)
* The path is url-encoded, and the protocol is set to "file"

Fixes #10964.
2014-06-25 10:45:03 +02:00
Adrien Destugues 6bcbdcc3c0 Use current Errors.h when building libbe_build
This allows adding new error codes to the libbe_build without breaking
the build on older Haiku versions.

Fixes the build for the newly introduced B_PARTIAL_READ and
B_PARTIAL_WRITE.
2014-06-25 08:59:14 +02:00
John Scipione 29e8fa5922 Style fixes to Support Kit files 2014-06-24 19:30:54 -04:00
Ingo Weinhold 84297881bb Remove BPackageKit::[...]::AbstractDataWriter and friends
* FDDataWriter and ZlibDataWriter weren't used anymore.
* AbstractDataWriter was implemented only by PackageFileHeapWriter,
  which was only used by WriterImplBase.
* Add a PackageFileHeapWriter::AddDataThrows() which has semantics
  equivalent to the previously inherited WriteDataThrows().
2014-06-23 22:58:15 +02:00