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 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
The previously implemented behavior of strptime() allowed for partial matches
of strings. For example, if the format string was "%a, %d %b %Y %H:%M:%S", it
would successfully parse "Sun, 07 Dec 2003" as input. This is inconsistent with
the standardization in POSIX.1-2001 (and later).
This change makes strptime() return an error if there is no more data in the
buffer and not the entire format string is parsed.
Change-Id: If066c49fb7fc094f8ccd56703cd01903a0e40cb3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5298
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
These utilities convert timestamp strings that are formatted according to
the HTTP RFC into BDateTime objects, and vice versa.
Change-Id: Ia2498944fb63d09233839f19d08f15d82a0a9685
the code is moved in the Port class.
Change-Id: I3beb337e29b26ee4732224723c5b76b5f415a248
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5291
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
* also handle dp aux on PCH.
* tested on Gen7, should work from Gen6.
Change-Id: I8d99bcdc10c817e66441a6a644df490dd988a74d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5290
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
AAPCS64 requires stack to be aligned to 16 bytes.
Additionally alignment might be enforced by hardware for every sp-relative
access depending on configuration in SCTLR.
Change-Id: Idd4756dd19386eb491d926b8a9862fa7fa48e506
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5259
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
we enable every port interrupt instead of relying on the ports found in the VBT.
ATM only log the plug state when it changes.
Change-Id: I5175fb137d11f0114beb2915a4f363341cfe8e36
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5287
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
* BDB version from 111
* for DDI from Gen9
* for HDMI and DisplayPort from Gen6
* use the first port to create the mode list
* also probe DDI Port A
* the aux channel helps to select the correct dp aux registers.
Change-Id: I80549a6ec0477bed768cc5f388959b606d50c1b7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5286
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
- Remove referencing an undeclared identifier
- Instead of an assert, just log an error for XFS V5 filesystems
and don't try to mount them
Change-Id: I67303aff89b81a28b7333569fea8113b6020dc54
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5204
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
* Fully remove unused and deprecated functions.
* Comment as to which functions are deprecated.
* Rename _by_name functions to be without the suffix, as this is C++
and there's no reason not to use overloads here.
Change-Id: I4e2152f17806605eb965795417013cea800e661e
It causes crashes (see #17689) and I was unable to determine the cause;
and it causes very noticeable lag (see #16879.) It can be reinstated
once those problems are fixed.
How often this would have occurred before thumbnail support I'm not sure,
but at least now that we have thumbnails, the icons are changed out
with not insignificant frequency, especially on read-only filesystems.
* Use a JobQueue and BJobs to generate the thumbnails, instead of
spawning a potentially unlimited number of threads (which can
of course rapidly exhaust resources.) Use two threads: one for
smaller files, and another for larger files.
* Directly insert the new thumbnails into the icon cache once they
have been generated, avoiding the port-search dance on filesystems
that do not support writing attributes (or at least large ones.)
* Skip calling mimeset, is it not needed after the previous commit.
* Combine all the duplicated image-scaling logic into one function.
May help with or fix#17225, #17619, and other thumbnail-related matters
e.g. #17557. Also addresses comments from the mailing list last summer.