Commit Graph

1085 Commits

Author SHA1 Message Date
Máximo Castañeda
241f109ccb View: provide the transform between different coordinate spaces
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>
2022-11-13 04:04:30 +00:00
Augustin Cavalier
233c0ffd47 docs/develop: Add missed item to the branch steps and combine the last two. 2022-11-08 12:45:03 -05:00
Alexander von Gluck IV
28ca540854 docs/release: Bump these changes over to milestones
* There was a bit of overlap

Change-Id: I97b39a38cdb6b3b96aafb42fa1b5a6ed447a6d3c
2022-11-04 15:00:02 -05:00
Alexander von Gluck IV
b5e4f1faa3 docs/release: Extend release engineering documentation
Change-Id: Iade40740e6dfbc7ea5f3f74f572d70443f94841a
2022-11-04 14:38:14 -05:00
Niels Sascha Reedijk
1111dda699 NetServices: Add libnetservices2.a from dev/netservices into master
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
2022-11-02 01:37:17 +00:00
Máximo Castañeda
baf401757e HaikuBook: small list levels and grammar tweaks
Change-Id: I186e38108a57a8a8b82dbfbdf27766730fe659e4
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5774
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Oscar Lesta <oscar.lesta@gmail.com>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-11-02 02:12:23 +00:00
Augustin Cavalier
20136c336c docs/develop: Linkify version-change hrev. 2022-10-31 23:29:20 -04:00
Niels Sascha Reedijk
2710b4f5d4 Merge remote-tracking branch 'origin/master' into dev/netservices
Change-Id: I48c8cf4f03e281a5caeb9f27bf052285961529ff
2022-10-29 22:58:24 +01:00
Augustin Cavalier
5de85b8f98 docs: Remove the User Guide and Welcome pages.
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.
2022-10-25 18:38:28 -04:00
Niels Sascha Reedijk
97f11716bf Merge remote-tracking branch 'origin/master' into dev/netservices
Change-Id: I588c4a840523995f820161d63741c137bc5c719c
2022-09-04 07:30:59 +01:00
Niels Sascha Reedijk
27196c4068 NetServices: use BBorrow<BDataIO> for custom body targets
Change-Id: Ib2d4b0ca3689338d906f943295278c086c6f2c83
2022-09-04 07:27:08 +01:00
Niels Sascha Reedijk
1e22817dfb NetServices: add the BExclusiveBorrow<T> smart pointer
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
2022-09-04 06:54:37 +01:00
Máximo Castañeda
2eab9be564 HaikuBook: fix xml
Change-Id: If6dfe4de919d946f1ff19946e1fa1abe726ea95f
2022-09-02 12:12:01 +02:00
Augustin Cavalier
f5fcee0157 BAlert documentation: Clarify that SetIcon assumes ownership.
It always did, this documentation was incorrect.
Also, we introduced this method, it wasn't present on R5.
2022-08-26 21:25:23 -04:00
Niels Sascha Reedijk
8a16ecbce9 NetServices: Add debugging constants and messages
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
2022-08-14 14:53:48 +01:00
Mashijams
a3d8402537 Docs: xfs
Change-Id: I2da4c778801e4c34ffe75d19c0c5c9323979f5f0
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5533
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
2022-08-08 15:25:26 +00:00
Niels Sascha Reedijk
7b1d966cf2 NetServices: Rework parsing of content-length and move to HttpParser
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
2022-08-08 07:58:45 +01:00
Niels Sascha Reedijk
9cb56a4881 NetServices: Add custom error message to BNetworkRequestError
Change-Id: I03970762531a689e25cd78a1091aecf755ee87ce
2022-08-07 08:47:19 +01:00
Niels Sascha Reedijk
6d1bb0e7ad NetServices: Remove BHttpRequest::SerializeTo(BDataIO*)
The private version that serializes to a HttpBuffer is now used.

Change-Id: I034933a641e98b3a8f918470a024ba32ea7c8663
2022-08-07 07:17:38 +01:00
Niels Sascha Reedijk
c7f925c3ee NetServices: add the HttpSerializer helper to help serialize requests
Change-Id: Ide1e2d387884ce4cf2d406057960cd0732d61f38
2022-08-07 06:47:15 +01:00
Niels Sascha Reedijk
9b33a931f1 NetServices: Implement controls on the number of concurrent requests.
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
2022-07-27 09:02:09 +01:00
PulkoMandy
264f77da03 docs/develop/release: add the info from the ReleaseCookbook Trac wiki page
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>
2022-07-24 14:11:55 +00:00
Niels Sascha Reedijk
60355daec9 NetServices: Implement asynchronous status update messages.
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
2022-07-24 08:56:02 +01:00
PulkoMandy
3c1a967efb docs/develop: add some documentation for userlandfs and FUSE
Change-Id: Ic8ee1bb5b3ca3e926251db766a120c48b96af45c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5488
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-07-20 20:34:28 +00:00
Niels Sascha Reedijk
b74e852fd9 NetServices: Remove Accept as standard and protected header.
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
2022-07-20 06:28:17 +01:00
PulkoMandy
abc159e3fd docs/develop: explain vendor branches for gcc and buildtools
Change-Id: I9bb3b4efd2d02013da1ec6656adb49cd7d050e86
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5476
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
2022-07-17 07:37:53 +00:00
Alexander von Gluck IV
fd482d0a57 docs/develop: Introduce release engineering documentation
* 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>
2022-07-15 15:31:13 +00:00
Leorize
86fa1c21e1 Shared Kit: Introduce BMemoryRingIO, a thread-safe ring buffer
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>
2022-07-11 16:29:53 +00:00
Augustin Cavalier
d6fedd7fcf Userguide CSS: Fix banner color. 2022-07-06 12:01:20 -04:00
Pascal Abresch
05844f660c Userguide CSS: add dark mode
Change-Id: I94c308ea22a304f061544a28e1490b9c004191d2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5329
Reviewed-by: nephele <nep@packageloss.eu>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
2022-07-06 15:49:23 +00:00
Niels Sascha Reedijk
92357c131e NetServices: Add support for an input body in a request and handle this with redirects.
Change-Id: Id2399d49aa673469c8c04ebd13884cdbcb24112d
2022-06-23 21:13:35 +01:00
Niels Sascha Reedijk
6cbbd9bf4e NetServices: Implement BHttpSession::Cancel()
Change-Id: Iff0a7726e57f3e6bd4e9d0ebac08a370d25a62d7
2022-06-03 13:38:28 +01:00
Niels Sascha Reedijk
2f3b9b18ac NetServices: Add/rework the MaxRedirections, Timeout and StopOnError options
Change-Id: I4e59b51c16c6777941dc92ce02505386257dad03
2022-06-03 09:40:42 +01:00
Niels Sascha Reedijk
f9d9d20245 NetServices: Add support for Basic authentication
Change-Id: I304104f7096fd935212e1bfa3e988e7945cb5cec
2022-05-29 15:13:54 +01:00
Adrien Destugues
4b0d8831c2 HaikuBook: better doc and example for BList::DoForEach
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>
2022-05-26 07:49:01 +00:00
Alexander von Gluck IV
6ec74693c7 docs/develop: Document how to build source hpkgs
Change-Id: I86a6cef5773c543e1b46d85091b9e73a7e3c016c
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5342
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-05-25 12:48:27 +00:00
Jessica Hamilton
a0a83410c4 docs/BList: fix DoForEach to match BeOS.
* 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>
2022-05-24 04:35:46 +00:00
Niels Sascha Reedijk
f751534257 NetServices: add optional fields to BHttpRequest
Change-Id: I6228419a55c81203ce2c26827d17ff6a402d86c5
2022-05-15 16:43:07 +01:00
Niels Sascha Reedijk
46b7da1f4f Merge branch 'master' into dev/netservices
Change-Id: I1eb6c2ea2fd0d794ad6378eab8bbb80ce46dfbb8
2022-05-08 09:00:42 +01:00
Niels Sascha Reedijk
cf54474e38 NetServices: Implement BHttpTime, parse_http_time() and format_http_time().
These utilities convert timestamp strings that are formatted according to
the HTTP RFC into BDateTime objects, and vice versa.

Change-Id: Ia2498944fb63d09233839f19d08f15d82a0a9685
2022-05-08 06:59:51 +01:00
David Karoly
dea541c4f4 docs/arm: update info for Raspberry Pi 2 & 3
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>
2022-04-23 18:18:13 +00:00
David Karoly
e5165df648 docs/arm: remove TODO item for soft-float
soft-float/hard-float mismatch issues are tackled by introducing
libgcc-boot, libgcc_eh-boot, libsupc++-boot libraries in the
gcc_bootstrap package

Change-Id: I4d3eff12c4c78804cd1dd32d6c1c5c8a9b5ad51a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5238
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-23 18:17:19 +00:00
Niels Sascha Reedijk
13bfff7be3 NetServices: Implement BHttpStatusCode, BHttpStatusClass and Redirects
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
2022-04-23 18:30:38 +01:00
PulkoMandy
d0c94afe0c docs/develop: fix incorrect title level 2022-04-23 13:59:49 +02:00
David Karoly
ba0c49863a docs/arm: add info on Raspberry Pi 4
Change-Id: Ic8cc47394c9e49f05e30b5ba54ff70557b1e2c47
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5237
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-23 09:18:03 +00:00
David Karoly
097f72e92c docs/arm: update info for Raspberry Pi 2
Change-Id: I968752c3eae56bee099f3cec5db7856dbe007592
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5232
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-22 10:50:59 +00:00
David Karoly
be7333a8d7 docs/arm: add info on Raspberry Pi 3
Change-Id: Iee7bd2f99dfc11930a97683c2cf30c51110d6726
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5229
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-22 10:00:39 +00:00
David Karoly
2ba1112f62 docs/arm: remove TODO item for KDL hangman
It seems to be already implemented.

Welcome to Kernel Debugging Land...
Thread 14 "main2" running on CPU 0
frame            caller     <image>:function + offset
 0 801bc898 (+2145662824) 801b9734   <kernel_arm>  (nearest) + 0x00
kdebug> kdlhangman
word> ____
hangman> e
word> ___e
hangman> t
  ____
  |   |
  |   O
  |
  |
  |
word>

Change-Id: I40aa484a69a76482ddd8508d493b6c52c11558fb
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5228
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
2022-04-22 09:46:30 +00:00
PulkoMandy
b5ab38ecf0 Add some docs about our compilers and patches done to them.
Change-Id: I60e0960499aec789ae6240eec949249adb2e35ad
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5224
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
2022-04-21 17:53:48 +00:00
Niels Sascha Reedijk
59c359e5a9 NetServices: implement support for HEAD requests and 204 responses.
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
2022-04-18 14:34:46 +01:00