There's currently no way for an application to convert between view and
drawing coordinates with a drawing states stack without keeping track of
all the transformations itself, which is not very convenient for helper
or library functions.
Handle other spaces too, for good measure.
Change-Id: Ic8404a1c111e273fff1eebf2f9f59f58246b796c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5775
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
The overall design does not deviate much from my proof of concept [2] and that still makes a good read to
understanding the overall architecture. If you want to get a sense of how it is built up, the API comes with
full doxygen documentation for the public API [3], and I have also done a PoC change for HaikuDepot which is
useful as an illustration on what the impact for the user of the new library is. [4] There is also a test suite
that may give some insight into the day to day ergonomics of the API [5].
The current state is that I am fairly confident that many HTTP requests will actually work, but I do expect
rough edges with a protocol with this many diverse implementations. There is also a list of features yet to be
implemented on Trac [6]. Additionally, I still want/need to do performance testing.
The goal of merging the kit right now is to start making it available for more uses, and through that also give
a chance to shape its future. There are also some design decisions that need review, most notably I expect some
discussion around the uses of C++ 17 idioms (like std::optional and std::string_view) and around the use of
exceptions for error handling.
The impact of merging right now should be near zero: the netservices2 kit lives in its own header space, and
builds into its own static library (libnetservices2.a). It is not yet used in any of the apps in our
repository.
The branch does remove the deprecated services kit from the libnetapi.so library, though it leaves
libnetservices.a intact. After our previous announcement to remove it after beta 3, this should be expected.
[2] https://github.com/nielx/haiku-netservices-rfc/tree/exceptions
[3] https://git.haiku-os.org/haiku/tree/docs/user/netservices?h=dev/netservices
[4] https://review.haiku-os.org/c/haiku/+/5692
[5] https://git.haiku-os.org/haiku/tree/src/tests/kits/net/netservices2?h=dev/netservices
[6] https://dev.haiku-os.org/wiki/Development/NetServices2
Change-Id: I5d0b7e2619699f39a2506588417b57391f0f5cc2
These were not maintained here, merely mirrored from the Userguide Translator,
and rather infrequently at that. But as they were built with Haiku,
that meant new versions of these packages were built every hrev,
which meant a lot of wasted space and bandwith for updates.
Now there is a separate "userguide" repository which will collect the
files exported from the Translator, and recipes at HaikuPorts to build
the packages, instead, so we can delete these files from this repo.
This smart pointer is designed to help with putting some explicitness and
safety around the case where someone will use their own object that implements
the BDataIO interface to store the body of a network request. By default,
BDataIO objects do not require or enforce thread safety. Since accessing these
unsynchronized objects between two threads is undefined behavior, it should be
explicitly discouraged.
The BExclusiveBorrow/BBorrow smart pointer helper helps solve that by enforcing
the limitations on using an unsynchronized object in two threads. When used
correctly, there is a runtime check on incorrect use by the developer. This
should help write better code.
The design is based on shared_ptr, including having an admin block akin the
control block, that manages the internal object. This type-erased admin block
has the advantage that it allows the owner to have a different type than the
borrower. It also handles cases where the lifetime of the borrower is longer
than the owner: the borrower can continue to use the object until they want to
return it, after which it will be cleaned up. This will make it possible to do
some fire and forget pattern in the network services kit, where someone may
just wants to create a file and borrow it to the network request, and care
about further processing the file in the future.
Change-Id: Ie9b7e7472c868b60f663b4db4fa449d421e447eb
These allow for additional messages about the progress/status of the request.
For now, the messages are sent unconditionally, though it may be reasonable to
in the future switch to sending them only when enabled.
Change-Id: Ic45a0055037af02c689494fa5ce0acd03592ad7e
This fixes a bug in the HttpAuthTest, and in general, moves responsibility of determining
the shape and size of the content to the right place.
Still to do is to fix the case where there really is a variable length content. This will
now probably error out as a connection closed error.
Change-Id: I13c20028e834cc9af8c7bc1d7d7613bf60838e64
This change allows the user to control how many concurrent request can be done
per session. This is going to be helpful to running the tests as well; they were
all fired up in parallel, which sometimes leads to our test server refusing a
connection.
Change-Id: I4f1f40b28b8e0199ea5589b36cd8d00ecd849a63
The corresponding Trac wiki page can be deleted once this is merged.
Some of this information is a little out of date, help is welcome on
updating it.
Change-Id: I9157b140bcb5de3fed3c95d994745b5a1cbee1f6
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5477
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
The integration PostTest has a basic test that the expected messages are sent and
have the expected data fields. The gist is documented in book.dox.
To do are the messages around SSL. However, that functionality is also not
implemented yet, so there is nothing to send.
Change-Id: Ib8f36ed32f9854d643d8256338b71af7067059f0
In the old service kit, the Accept header was automatically set. However, it is
not a required header. This removes the default value and the protection against
setting it manually.
Required to make HaikuDepot work.
Change-Id: Ic589bfc5829db25915b67f2a13b6c2436c053e25
* This has been floating around on trac forever. We should formalize
these steps to help future Haiku releases to be successful.
Change-Id: I5881e27a23e66a18539d04c5977593a827f8fcef
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5441
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
This commit introduces a simple thread-safe ring buffer implementation
based on top of BDataIO. The main use case for this class will be to
implement shared buffers between threads for the upcoming refactoring
of Services Kit.
Change-Id: I526bc044b28c91496ad996fabebe538e75647f2c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2966
Reviewed-by: Jacob Secunda <secundaja@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
The description of the callback function was still quite confusing. The
main usage for the return argument from the callback function is not
handling failures, but knowing wether the function did something in the
list or not, and stopping the iteration if only one item was looked for.
Add an example use of the function return value to implement a linear
search in the list and remove the note about the function "failing",
which is not what this parameter was meant to do (and I think that lead
to the initial inversion of "true" and "false" values.
Change-Id: If8cae8b8ee21ced2c899aef6033a89ab8dbf1621
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5339
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
* The function passed to `DoForEach` returns `true` to terminate
the loop early
Change-Id: If445836b14c44b981d169564e7beab8c0ecac36f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5336
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
These utilities convert timestamp strings that are formatted according to
the HTTP RFC into BDateTime objects, and vice versa.
Change-Id: Ia2498944fb63d09233839f19d08f15d82a0a9685
Add some more details on peripherals.
Change-Id: I65e6ce5ff32cd8b40b95a707460a870f0f4d688e
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5239
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
The user of the API can set whether redirects should be followed, and if so,
how many. This is part of the BHttpRequest API. The BHttpSession then follows
those instructions, and executes the maximum number of redirects the user
would like to follow.
As part of this commit, the BHttpStatusClass and BHttpStatusCodes helper enums
have been added, to give a friendlier access to HTTP status codes and status
classes.
Change-Id: Ic8c9e3fda158e2cce549c8f1d360951f7ac83311
These particular responses will not have a body. This is now handled by the
BHttpSession object. There is also a minor fix in here that prevents a crash
when multiple requests are handled by the DataThread at the same time, and not
all of the requests have events.
Change-Id: I7f47d8b3cd8491c8193275be4b3fc1080780fa20