Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
It can give results such as "in 2 hours", "2 days ago", etc.
This is different from BDurationFormat which will just say "1 hour, 2
minute and 36 seconds"
When using BAffineTransform, the update rect is not in the same
coordinate space as the drawing rectangle. Hence, testing them for
intersection does not work, and leads to not drawing buttons which are
in fact visible.
Moreover, the code in BControlLook does not perform only drawing, it is
also expected to update the drawing rect, so other functions may reuse
it later (for example, drawing a button border also computes the
rectangle for the button background). Because of this, it is not
possible to skip the drawing completely, or we could break the layout of
the client.
Fixes#13664
ConstrainClippingRegion was used in BControlLook to limit drawing to
inside the update rect. There are two problems with that:
- It would ignore any other clipping set by the application, as calls to
ConstrainClippingRegion are not cumulative,
- ConstrainClippingRegion ignores transforms on the view, so on a
transformed view, we would not draw anything in most cases.
If constrained clipping is needed here, it should be achieved using
ClipToPicture instead.
A '&' (reference) was missing on a specific line, causing
font information to never be updated. Also removed extra padding
dependent on a constant variable - if it is used, the label will
be render too far down.
Fixes#12981.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
More background work for later performance improvements.
This change generalizes the parsing of meta-data from
JSON streams as similarly structured meta-data is
anticipated to be carried in other payloads. Unit tests
have also been implemented to provide coverage on this
new functionality.
* Sentence casing
* Localize notification texts in the package kit
* Have "Package daemon" as group name and "Warning" as title
* Use ::BPrivate in Bitmap.h to solve an ambiguity (as pointed out
by PulkoMandy). Though not needed for my changes any more, since
a the icon of the notifying app is now shown by default.
Fixes#13590.
On an empty line terminated by \n, we would access the temporary buffer
(stack allocated) with an index of (uint32)-1. On 32bit machine this
would just read the byte before the array on the stack, but on 64bit it
would crash.
Check that the length is at least 1 before trying to access a character
in the array.
Fixes#13625.
Thanks to accessays for proofreading the code:
* stop the extractor processing before deleting the source.
* crash happened in MediaPlayer FilePlaylistItem::_CalculateDuration().
* was a regression introduced in hrev50671.
* fixes#13156.
It is too similar to the long format and does not add much value.
And it creates some problems with using a locale format with another's
string.
Fixes#11343.
* Almost all Enter keystrokes were hijacked without the ability to
reconfigure.
* Let apps use these shortcuts.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
Changing the year in Calendar View does not remove the highlighting from
previous highlighted day.
Changing the system date to a date in a different month(different from
the month currently set in calendar view) does not remove the highlighting
from currently highlighted day.
The disabled day number text belonging to the next month (month after
the one currently selected) gets wrongly highlighted while attempting
to highlight the day number text belonging to the current month.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
ticket : #13605
* Issue: In BCalendarView presently, there is no notion of a current date
and the current date is not highlighted. So in the deskbar tray calendar
which uses BCalendarView, we cannot know the current date once we change
the selected day.
* Fix: Make BCalendarView accept pulse messages, check for system date
with every pulse message and update the current date accordingly.
Highlight the current date by rendering its day number text in a
different color.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
ticket : #13592
Commits merged from the semi-official Git mirror of NetBSD
trunk (https://github.com/IIJ-NetBSD/netbsd-src/).
Commit authors/messages in chronological order follow:
---------------------------------------
From: maya <maya@netbsd.org>
Date: Tue, 9 May 2017 02:56:44 +0000
Subject: Avoid shift of negative signed integer. this is UB. NFC.
Nothing in the Mail Kit proper uses OpenSSL directly anymore
(confirmed with a grep for USE_SSL as well as "openssl"),
so we don't need this logic anymore.
Also remove the BMessageFilter EscapeFilter and use B_CLOSE_ON_ESCAPE
in the window constructor instead.
I moved fExpressionTextControl->MakeFocus(true); down to when the
window is Lock()ed. Otherwise the text control refuses to be focused...
Cookies with expiration on a sunday would be misformatted, which could
lead to websites not recognizing them.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Fixes 13543
This allows to fit a lot more text in the same horizontal space, so we
can fit the label in various locales, without spreading the checkboxes
further apart.
Fixes#6987
The non-locale aware version is kept in src/build/libshared for use on
the host system and in packagefs (kernel add-on). In both cases, ICU is
not available.
Fixes#8192
- Strength is now set once, instead of at each comparison, to improve
performance and fix potential locking issues
- Add a way to enable "numeric" collation (aka "natural order")
Handle the UDAT_DAY_OF_WEEK_FIELD case and assign the corresponding
BDateElement object i.e B_DATE_ELEMENT_WEEKDAY to the fields array
at the appropriate offset.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Fixes#13529
NetworkTargetHostInterface:
- Fix missing initializer. This would lead to a crash in the destructor.
NetworkTargetHostInterfaceInfo:
- Implement IsConfigured() to validate passed in settings.
- When adding the TargetHostInterfaceInfos to the roster, Init() was not
called on the individual instances, leading to them potentially being
incomplete.
If you disallow and then re-allow characters, so that the number of disallowed
chars returns to zero, BTextView::Archive will fail with "Invalid Argument".
Fixes#13520.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
This fixes the bugs pertaining to drawing and erasing the blue border
when a view gains and loses the focus, respectively. It also fixes the
bug that the file list (PoseView) always has a blue border when the
panel window is activated, even if the pose view doesn't have the focus.
Fixes#13496.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
* Issue: BTimeUnitFormat doesn't incorporate style formatting while
formatting a time unit. Format() does take style as an argument but the
style is not used anywhere. So currently the abbreviated style doesn't
work and by default the time unit is formatted to the full style.
* Fix: Move the style flag from BTimeUnitFormat::Format() to the
BTimeUnitFormat constructors and call the relevant icu::TimeUnitFormat
constructor. Map the Haiku defined style unit to the corresponding ICU
unit. Move the style flag from BDurationFormat::Format() to the
BDurationFormat constructors to map the changes in BTimeUnitFormat.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Fixes#13508
This change will introduce a streaming parser capability to Haiku. The
existing functionality of writing the JSON data to a BMessage in-memory
model is retained. The new parser implements a SAX-style listener based
interface where the listener accepts parse events. Unit tests have been
supplied for the JSON parser as well.
Always enable the default button in Open File Panel if the node flavors
include B_DIRECTORY_NODE.
Fixes#13463.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
BFont::Blocks is now implemented in ServerFont, via a call through the
app_server. It uses fontconfig to iterate through a charset of a font
and stores the defined blocks in a bitmap.
A new API was added, BFont::IncludesBlock, that will allow for arbitrary
testing of a given Unicode block. Since nothing is cached, searching
through an entire charset for a series of Unicode blocks can be quite
slow. In a given block there may be only 1 or 2 characters actually
defined so every character within a block needs to be checked until one
is found, which in a degenerate case will mean the entire block is
checked.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
* This clarify the ownership of the source when using the experimental
API.
* The extractor/writer are simplified and don't have to care about
adapters.
* MediaStreamer is able to provide a generic BAdapterIO that is
suitable also for different uses than the codecs API itself.
For icon sizes less than B_LARGE_ICON (32) the icon size was
incorrectly just set to B_MINI_ICON (16) causing an error in where
horizontally the free space bar was drawn for icon sizes between 16
and 32. This has never really been an issue because the predefined
options in Tracker do not allow selecting an icon size between 16 and
32, but this fix will prevent drawing issues in the future if that
ever does become an option.
Using BFilePanel with multi-selection turned off does not prevent
multi-selection by SHIFT-click. Traced the bug to
BPoseView::AddRemoveSelectionRange(), and the safest fix is to not
touching the boolean extendSelection but to just add the test for
fMultipleSelection to the if block that handles B_SHIFT_KEY.
Fixes#13462.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
In its original state this code just forwarded all clipboard messages to the
focused view, which sometimes was a BTextView or the like which knows nothing
about Tracker's custom clipboard events, and thus would wind up in an infinite
loop.
Now, the messages are left to be handled by the focused view if a BTextView
is selected (e.g. in a file panel, or in Tracker's navigator), but otherwise
forwarded directly to the BPoseView.
Fixes#12721.
fixes the bug that caused multi-selection by SHIFT-cliking to fail if an
item in the file panel was selected by a key (ticket #13460).
If the user tries to select a single item by pressing a key (Left/Right,
Up/Down, etc.), the BPoseView::KeyDown() function will call the
BPoseView::SelectPose() function, which must set fSelectionPivotPose to
the selected item (or pose) because this item might be the starting (or
pivot) pose of the next multi-selection by SHIFT-click.
Signed-off-by: Axel Dörfler <axeld@pinc-software.de>
I've felt for a long time that the Desktop's background colour had to
be much too dark for the icon labels to switch from black to white.
I came to the new values by trial and hope nobody hates those now...
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
As required by POSIX:
"If the specified address family is AF_INET or AF_UNSPEC, address
strings using Internet standard dot notation as specified in inet_addr
are valid." (which allows IP in a.b.c.d, a.b.c, a.b, and a forms, and
also accepts the numbers in hex and octal).
Fixes#3884.
* It's very important to use a negative value to identify
non valid or uninitialized connections. Additionally, it's preferred
to don't interfere with media_kit types as long as the framework use
it in the backend.
BListView automatically sets the vertical scrollbar range already. Do
the same for the horizontal scrollbar.
Also fix BOutlineListView to compute the preferred size taking into
account the items outline levels (it needs a little more space).
This fixes the horizontal scrollbars in Locale preferences, second part
of #6747.
* BView incorrectly passed the current width and height to
FrameResized(), not the one from the message. Since there is such
a call for each size change, a Draw() might have been called for
each of those in return.
* This should also fix such problems in BMenuBar, as it used the size
from FrameResized() as it should have.
* BBox now correctly takes the update events into account, and no
longer ignores the size passed to FrameResized().
* This fixes bug #3037.
Bug fix- show correct version on package uninstall list item tooltip
Correct if else formatting
Use the BPackageManager FullSync() function instead of Update
Change warning strings in BPackageManager to sentence casing
Show list item tooltip on a mouse down (helps with touch devices)
This corrects hrev50847. Turns out we need 8 lines for normal
files and symlinks, not 7. Fixes#13308.
The "Opens with:" label used the decreased font size set in
src/kits/tracker/InfoWindow.cpp:894. Increase font size by 2 again
for the label.
This reverts commit 945566ff43.
As discussed on the mailing lists and with Humdinger off-list:
* The general design concensus tends slightly towards DejaVu, as metrics
of DejaVu look much better (DejaVu 12 and Noto 13 are roughly the same size,
but Noto has much wider margins with that)
* While Noto does have a wider set of fonts with support for lots of
different languages, DejaVu actually has built-in support for more
Unicode languages (the default Noto has, as far as I can tell, only
Latin/Greek/Cyrillic [2416 glyphs], while DejaVu also has Armenian, Georgian,
and a few other scripts too [5119 glyphs].)
* The worse rendering of DejaVu appears to have been somewhat rectified by
disabling the average-based subpixel filter in app_server.
Update all in-tree consumers of the BJson API to match. Also added
const-qualifiers to the BString versions of the API, and added the leading
"_" to the header guards.
As found on http://seriot.ch/parsing_json.php -- anything using the API
presently with valid JSON should have no troubles, but more valid JSON
that previously didn't work now does (e.g. JSON with root array nodes, not
root map nodes), and invalid JSON that silently succeeded before now fails.
Not all the bad cases from that testsuite now fail, and not all of the good
ones pass, but the few that remain are odd things that wouldn't map well to
the BMessage API (e.g. root string nodes, etc.) or are other behaviors that
make sense to leave as they are for compatibility reasons.
The existing HTTP header date format handling code is employed
rather than using specific logic for HD. Also the "Location"
header handling is changed to work better for non-absolute
URLs arriving in this header value on a redirect. Both
suggestions from Adrien.
The asynchronous listener had no reliable way to access HTTP result and
headers from the callbacks. As the callbacks are triggered
asynchronously, they can be run after the request has carried on and,
for example, followed an HTTP redirect, clearing its internal state.
The HeadersReceived callback now passes a reference to BUrlResult for
the request. There are two cases:
- Synchronous listener: passes a reference to the request's results
directly
- Asynchronous listener: archives a copy of the result into the
notification message, and passes a reference to the unarchived copy.
Unfortunately this comes with several ABI and API breakages:
- Change to the prototype of HeadersReceived()
- Change to the class hierarchy of BUrlResult (implements BArchivable)
All users of HTTP requests will need to be updated if they implemented
in HeadersReceived or used BUrlResult.
The main lock on the cookie jar must always be locked before the rwlocks
for each domain list. This was reversed in one place, leading to a
typical deadlock pattern. Fixes one case of freeze in WebPositive: two
request threads whould interlock, and then anything trying to access the
cookie jar (including the main thread of Web+ to handle javascript
access to cookies) would also lock.
* I was pretty sure that I didn't change the logic, but turns out
I was wrong. Sorry about that.
* Adjusted copy-pasted comments.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Fixes#13238.
* A TimeSource need an additional hook called FinishCreate to be
able to create it's transfer area. This hook was called after the
node registration making room for potential mismatch of the transfer
buffer. Most media nodes such as an event looper call
begin to work with time related functions just once the registration
happens. It could cause shadowed timesource objects initialization
to fail too.
* Add a debugger call to prevent any node to use an unitialized
TimeSource area, that would help to identify any remaining issue.
Previously it would warn only below 20MB of free space, if this was
less than 10% of the drive's capacity. This is obviously ridiculous now.
The first suggested patch used a simple 10% as the new criteria, but that's
a little high -- 100GB out of a 1TB drive is still a bunch of space left.
5% seems like a more appropriate choice here, and preserves a behavior
closer to the original 20MB on smaller (older) drives (5% of 500MB = 25MB.)
If this turns out to be too annoying for some users, we can make the check
more refined than it is now, but I don't think that will be necessary.
Fixes#4520.
When renaming an entry at the edge of a PoseView, the input
would not resize as usual. This change ensures the input
becomes resizable again if the text becomes small enough.
Fixes#3438.
Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
* Addresses TODO of sub-classing controls, registering with the
media roster for parameter changes.
* Also adds support for discrete parameter controls, which didn't
have this functionality.
* With this change, the controls no longer need to be focused or
modified for the parameter changes to register.
fMinValue was getting set to INT32_MAX then set to INT32_MIN
fMaxValue was not getting set
now set fMinValue to INT32_MIN, fMaxValue to INT32_MAX
also in _InitObject()
... reverse this to avoid confusion, you'll see why in next commit.
No functional change intended in this commit, functional change is in the
next commit.
As discussed in 2008
(http://www.freelists.org/post/haiku-development/BString-on-GCC4,1),
this class was not efficient because of lack of inlining. Implement the
suggested solution of a SetCharAt method instead. Also add a CompareAt
which covers a specific use case in KeyboardLayout.cpp.
Adjust all places which were using this feature to safer APIs.
Also fixes a copypaste error in FormattingConventions.cpp.
Based on the amazing work of puckipedia, this gets BePac Deluxe to play
fine on Haiku (complete with sound effects and music).
This is based on his original patch, but the irrelevent parts (working
around bugs in ffmpeg that were fixed since then) are removed.
Fixes#9939.
It is used by the media kit, which created a dependency from libmedia to
libbnetapi to openssl.
It is not entirely specific to the network kit, there are some use cases
that don't involve network at all.
* Fixes problems with setting the partition name after uninitializing
a partition in DriveSetup. Previously, UninitializeJob() was
followed by SetStringJob(), but the kernel was updating the
change counter for the parent partition when uninitializing a
partition, leading to SetStringJob() having an incorrect change
counter for the parent partition. Now the parent change counter
will be correct when SetStringJob() runs.
- According to the Be Book, one of BListItem::Update()'s responsibilities
is updating the item's internal height/width. However, while we were
providing such updates in the case of the item initially being added
to the view, or when the list view's font was changed, we were not doing
so on frame resize. This would lead to items having a stale width field
in such a circumstance, leading to possibly incorrect behavior in apps
relying on that field to be correct.
* There's no need to supply ways to mismatch the buffer duration
and size. Anything should reflect the media_format, this is at least
fixed on API level.
DebugReportGenerator:
- In the case where the function was already disassembled beforehand,
we weren't retrieving the statement, leading to a null pointer
dereference.
Revert "repo rework: Remove stubs; Breaks repo compat."
Revert "repo rework: Remove need for repos to be self-aware"
This reverts commit a2b2f4d642.
This reverts commit 602076ef82.
This reverts commit 5ffaf72c8a.
These changes break the build on Haiku and the ability to create repo
mirrors, for the lack of a replacement for the URL (an UUID was evoked
on the mailing lists, but not implemented).
We are due for a release soon, please don't break the build.
Revert "BNode: CID 602323 explicitly ignore fCStatus return value in ctor"
Revert "BNode: Set fCStatus in SetTo() explicitly"
Revert "BNode: Style fixes, see below for details"
This reverts commit ede463195d.
This reverts commit 6e3445098a.
This reverts commit 89c0b71c9a.
We are due for a release soon. Please keep things working.
Team:
- Adjust report generation event to include a final status code for listeners.
CliContext,TeamWindow,ReportUserinterface:
- Use aforementioned status code to indicate whether report generation
succeeded or failed.
DebugReportGenerator:
- Notify listeners if report generation fails. This may have previously
been responsible for some bug reports where it was indicated that the
debugger hung without exiting after being asked to save a report from
a crashed app.
- When dumping disassembly, retrieve it directly if necessary rather than
requesting it via the user interface listener. This also fixes the quirk
that requesting to save a crash report while looking at the source code
of a function would trigger switching it to disassembly visually.
- When walking the list of threads to dump, acquire references to all of
them before starting. Otherwise, it was potentially possible for a running
but not crashed thread to exit while we were generating the report, leaving
us with a pointer to a deleted thread. This was most likely the cause of one
of the crashes reported in #13082.
- When receiving the notification that source code state has changed, clear
the waiting function. Otherwise, it was potentially possible for us to get
other state change notifications, leading to the data semaphore being
released too often. This would then cause later potential waits such as
the stack frame memory dump to not actually wait when they should,
potentially leading them to dereference objects that weren't yet ready.
This fixes another of the crashes in #13802.
instead of setting it in _SetTo() and then again in SetTo()
fCStatus could be set even fewer times but this is a good compromise
(logically, performance wise it is not an issue).
Update copyright, add myself to Authors
Remove superfluous parens
Rename result variable to bytesWritten
Sync() Unwrap ternary style fix (for consistency)
* Shouldn't this return fCStatus instead of B_FILE ERROR?
* BeBook says "returning B_OK on success and an appropriate error message otherwise."
* Has returned B_FILE_ERROR since "it is accomplished ..."
Rename result variable to bytesWritten (again)
Remove superfluous space
explictly cast status_t to ssize_t
Remove superfluous parens, remove space, add newline
Explicitly cast status_t to ssize_t (again)
WriteAttrString() cleanup
* rename error to result
* rename sizeWritten to bytesWritten (consistency and clarity)
* check if error cede from WriteAttr and cast to status_t
* > not entirely style but functionaly same
* if length is different then written return B_FILE_ERROR
* > not a style change but a very minor functional change
* add some comments
Tiny documentation fix precede vars with \a
More style fixes
* Rename error to result
* Put parens around conditional of ternary instead of whole thing
* Compare against NULL explicitly
* Don't set fCStatus here, we're going to set it in the calling function instead
* > note that Unset() sets fCStatus to B_NO_INIT but that's ok
80 char limit style fix
More style fixes and don't set fCStatus
* remove superfluous parens
* compare ref to NULL explicitly
* > Also don't set fCStatus here since we will do that in calling function
Unset() sets fCStatus to B_NO_INIT but that's ok
Unwrap ternary style fix (consistency)
Rename error to result (again)
* The media_kit isn't an hard real time beast. Bounding lateness
looked like the perfect way to enable reasonable soft real time
performance and thus limiting port writes and reads between producers
and consumers. It seems to don't work very well so I just remove it.
* The result of the recent code simplification makes it equal to my
first version, before any discussion on it happened.
* Thanks to AlienSoldier for testing such issues.
* Fixes#13069.
* We saw 3rd party repos break as well oddly.
* Reintroduces the url field in a little bit cleaner
way.
* Should solve "Failed to open repository file" errors
* Once everyone updates beyond hrev50723 this is
no longer needed.
DebugReportGenerator:
- Due to the changes made with respect to correctly handling switching to
disassembly explicitly, the report generator needs to request loading
source files as it walks the stack trace in order to get source-based
line number information. Fixes crash reports having -1 as the line number
in cases where debug information was available, but the user hadn't yet
looked at the source file in question.
LoadSourceCodeJob:
- Cleanup.
* These stubbs satisfied older Haiku releases that
required the URL
* Users running nightly images will need to upgrade
to hrev50723 - hrev50744 before upgrading further
* Getting this out of the way now before the beta
comes out.
* New installations shouldn't suffer any problems.
ElfFile:
- The refactoring in commit 2c50fbb8e1
inadvertently introduced a failure case if a section in the ELF file
is skipped, since it was explicitly passing in the insertion index
to BObjectList::AddItem(). Since in the skipped case, this would be
out of bounds for the list's current size, this would cause the whole
operation to fail with an out of memory error, and consequently halt
all further loading of debug information for that particular file.
This manifested itself with libroot on at least gcc5, where no symbols
could be seen.
* See #12917 for details.
* Squashed to one commit to make revert easy if we
run into any issues.
* pkgman is now pre-attached to the 'current' repo
version within nightly images so they can be updated
by default.
* This shouldn't impact us keeping older sets of package
versions by commit hash for building older hrevs.
* There are XXX stubs with "Kill me". These will need
to be dropped after users are given sufficent time to
upgrade. We're dropping a previously required field (url)
so making this a slowish roll out.
* Makes the repos a lot less restrictive which should
help PM package building automation be a bit easier.
* Once this stuff smooths out, we'll add UUID's to the
repo definitions for duplicate repo detection.
* The idea is to move the callback based mechanism into a derived
class. The objects can be composed to create working systems.
* The BMediaClient class supply RegisterInput/RegisterOutput
and BeginInput/BeginOutput is moved to BSimpleMediaClient.
* Various minor fixes.
* Capabilities() become Kind()
* Use media_client and media_connection to better model
the different situations of the API. Reduce code duplication
and move media_kit structs/methods into private.
* Various API and beauty improvements.
* Introduce id management for media_connections.
* Fix different issues preventing to correctly begin a connection.
* Those structs are provided as replacement for the classic
media_kit ones. They provide better encapsulation of the data
and the resulting code is heavily simplified. It's planned to
introduce BMediaRoster functions to provide conversion from
media_node and media_input/media_output to media_client
and media_connection.
FunctionInstance:
- Add new state FUNCTION_SOURCE_SUPPRESSED. This signals that the user
explicitly forced disassembly to be loaded despite source code being
available.
LoadSourceCodeJob:
- When forced to disassembly, use the above suppressed state accordingly.
SourceView/TeamWindow/TeamDebugger:
- Adjust to take new state into account as needed.
TeamDebugInfo::GetActiveSourceCode:
- When looking at a function to decide whether to return line information
based on source or disassembly, first examine the source code state. If
the source has never been loaded for that function, but we have it available,
set it on the function at that point. This lazily addresses the fact that
LoadSourceCodeJob is called on behalf of a specific function, and
consequently only sets the source code onto that function, and not all others
present in the same file. This allows us to differentiate between the case
where a function doesn't have source code available at all, versus a function
that has simply been forced to disassembly view at this point in time.
The primary symptom of the above issue was that attempting to set a breakpoint
outside of the currently active function, but within the same file would result
in the breakpoints view indicating that the breakpoint was at line 0 rather
than the appropriate line, and breakpoints would also not be drawn in the
source view for such locations.
Thanks to Humdinger for the heads up!
* The BeBook states that any media_kit app should have BApplication
behind. Beware the app don't need to be running, but the object
should be present. This is because we use BApplication as a safe
exit point to free the memory allocated.
* While I was a bit reclutant in doing that, after a developer
discussion we agreed this would be the cleaner way to solve this
problem without eluding it.
* The BMediaClient is an higher level API to the media_kit. It
corresponds to what the layout API was for the interface_kit.
The main idea is to allow the developer concentrate only on
higher level details and avoiding handle with the tricky parts
of the media_kit. At the same time the general purpose node that
is implemented inside would allow implementing the best techniques
around thus at the same time reducing code duplication and increasing
efficiency.
* BMediaClient is WIP, this is the initial merge of the branch.
The initial development stone was set long time ago and walked
through various design/implementation phases.
Suggested by Adrien, to make the MIDI settings more future proof when
more settings will be added, and to make manual editing less error prone.
Moved the settings from B_USER_SETTINGS_DIRECTORY/midi to
B_USER_SETTINGS_DIRECTORY/Media/midi_settings.
The fSource can point to a source with code inside a media plug-in (in
particular, the HTTP source from the http_streamer plugin). However,
deleting the extractor can cause the plugin to become "unreferenced" and
unloaded. If we try to call code to delete the source later, we find
that the code is already unloaded, and the app crashes.
This happens in Web+ when navigating away from Youtube or otherwise
interrupting a video while it is being played.
Fixes the crashing part of #13058.
Parsing an URL can never fail. The regexp is designed to match any
input. In the worst case, everything will end up in the "path"
component. WebPositive relies on this to generate file URLs from a plain
path.
URLs without a protocol are also possible, and can be used with an
implicit protocol. A typical example is network shares sometimes noted in
"//host.domain/path/file" form.
Add tests for these two cases and fix the parser to behave as expected.
* Ideally we should support this feature by default to allow
future improvements to the plugins management.
* Fixes the major memory corruption that lead to various
crashes on exit in MediaPlayer.
This makes it possible for the Asynchronous listener to get the
messages. It can then process them in a more fancy way.
The default implementation will still log the messages to the console
(if debug is enabled), but it will do so from the Async listener for
asynchronous requests now. This means they will probably be logged from
the same thread, and show up in a more readable way.
This also makes it possible to listen to several requests and log them
in a nice way (in a status window or whatever).
Under a #define TRACE_SSL, should you need it.
Also load error strings when initializing the SSL context, so we get
human readable errors from SSL (also in the ser reported ones).
The HttpRequest protocol loop is designed using an input buffer storing
data from the socket. At each loop, we try to parse some of the data,
and then read more from the socket.
However, in some cases (in particular with chunks, which we parse only
one at a time in a loop iteration), we may not use all the data from the
buffer. Eventually, we will be left with an "empty" socket (nothing to
read from there) but the request not completed because there is still
data in the input buffer.
In that case, we would hang waiting for a read on the socket, instead of
processing data from the input buffer.
Change the code to read from the socket only if a loop iteration did not
manage to read anything from the input buffer. This means the input
buffer is too small for the next thing to process (it contains less than
one line of data, for example), and in that case we can safely read from
the socket without being blocked.
This should fix several cases where the network code was stuck doing
nothing, including https://my.justenergy.com/ reported in #13010.
- Remove uses of group matching regular expression, not available on all
build hosts,
- Parsing is faster than our old regexp engine.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
- Fixes#13002
- Fixed some indentation (tabs vs space), please configure your editor
properly.
- Fix parsing of strings shorter than 24 bytes (which can only happen if
the year has only 3 digits, or the day in month, hour, minute or
seconds have only 1).
- Only allow the GMT and UTC timezone specifiers, as all HTTP dates
should use the GMT zone (but still use a format that allows specifying
a timezone name).
All cookie tests are now passing.