Commit Graph

28494 Commits

Author SHA1 Message Date
Jan de Visser
e923cb3739 SQLServer+SQL+LibSQL: Allow sql client to specify the database name
The database the sql client connected to was 'hardcoded' to the login
name of the calling user.
- Extended the IPC API to be more expressive when connecting, by
returning the name of the database the client connected to in the
'connected' callback.
- Gave the sql client a command line argument (-d/--database) allowing
an alternative database name to be specified

A subsequent commit will have a dot command allowing the user to
connect to different databases from the same sql session.
2021-10-05 02:22:19 +02:00
Jan de Visser
c5c7a9d198 SQLServer: Do not capture stack variables by reference in lambdas
If you capture a stack variable by reference in a lamdba definition,
and this lambda outlives the scope of the stack variable, this reference
may point to garbage when the lambda is executed. Therefore capture as
little as possible (typically only ``this``), and what is captured is
captured by value
2021-10-05 02:22:19 +02:00
Tim Schumacher
c07f91474d Ports: Make array-like settings actual arrays
We may need entries with spaces in makeopts, installopts, and
configopts, and at that point we should also convert depends and
auth_opts to avoid confusion.
2021-10-05 02:13:08 +02:00
Tim Schumacher
e507cfcdb0 Ports: Set defaults before loading package.sh
This is too much bash magic for a simple "Use this value if the script
doesn't set anything", especially since only one default setting depends
on values from the script.
2021-10-05 02:13:08 +02:00
Ben Wiederhake
52e9f25403 Everywhere: Change from http to https where feasible
I used "git grep -FIn http://" to find all occurrences, and looked at
each one. If an occurrence was really just a link, and if a https
version exists, and if our Browser can access it at least as well as the
http version, then I changed the occurrence to https.

I'm happy to report that I didn't run into a single site where Browser
can't deal with the https version.
2021-10-05 02:08:08 +02:00
Idan Horowitz
ce334ee1bc Kernel: Validate x86_64 address canonicality before SafeMem operations
This ensures we don't GP on x86_64 when a non-canonical address is fed
to a safe_foo() operation.
2021-10-05 02:07:43 +02:00
Idan Horowitz
cd975668d6 Kernel: Detect and store the virtual address bit width during CPU init 2021-10-05 02:07:43 +02:00
Andreas Kling
d872f0d503 LibJS: Avoid an unnecessary String in create_mapped_arguments_object() 2021-10-04 22:54:50 +02:00
Andreas Kling
f4180b7269 LibJS: Avoid an unnecessary String in create_list_from_array_like() 2021-10-04 22:54:50 +02:00
Andreas Kling
a31855ae10 LibWeb: Improve resolved style for CSS {min,max}-{width,height}
If the specified value for these properties is "none", we end up storing
it as an "undefined" CSS::Length in the computed values.

We need to convert it back into "none" for getComputedStyle().
2021-10-04 22:54:50 +02:00
Linus Groh
fb98e12f86 Ports: Update Python to 3.10.0
Released on 2021-10-04.
https://www.python.org/downloads/release/python-3100/
2021-10-04 21:46:25 +01:00
kleines Filmröllchen
e5938e66f3 Base: Add audio documentation 2021-10-04 18:10:10 +00:00
Idan Horowitz
4bd089616e LibWeb: Implement window.location's stringifier
The location IDL interface includes a stringifier on the href
attribute i.e. the object's toString should return the value of the
href attribute.
2021-10-04 18:42:58 +01:00
Patrick Wilmes
b00218715a Documentation: Added unzip to arch install list
After setting up the toochain on manjaro linux (new install) the build
of the toolchain failed as unzip was not found. The unzip package is
listed in the documentation for debian (apt) but is was missing for arch
linux.
2021-10-04 18:30:41 +01:00
Tobias Christiansen
0c0951d2ce LibWeb: Flexbox: Don't outgrow parent in main axis when using wrap 2021-10-04 18:54:52 +02:00
Tobias Christiansen
6283086c2f LibWeb: Handle inline-block children of a flex-container as block
We don't want to wrap the inline-blocks the same way we want to wrap
pure inline children.
2021-10-04 18:54:52 +02:00
Tobias Christiansen
6102a486ee LibWeb: Flexbox: Collect empty inline-block flex children
A flex-child that was display:inline-block but also had no text inside
of it was previously skipped.
2021-10-04 18:54:52 +02:00
Ali Mohammad Pur
5b185d9cb5 LibHTTP: Bump max HTTP header size up to 32KiB
Apparently discord likes to feed us headers as big as 6KiB, so clearly
there are large headers out there in the wild.
For reference, Apache's limit is 8KiB, and IIS's limit is 16KiB (this
limit is not defined by the spec, so nothing can stop a server from
sending massive headers - sadly)
2021-10-04 18:26:16 +02:00
Sam Atkins
02a369a0a3 Documentation: Add documentation for adding IDL files
There are several steps involved, which are not at all obvious unless
you already know them. So now they're written down. :^)
2021-10-04 15:32:27 +01:00
Mahmoud Mandour
aca87ce146 sql: Account for the single quotes in syntax highlighting
Previously, a String literal token like 'hello' had every char
highlighted but for the last 'o' and the closing single quote. This is
because the token start is at the opening single quote but the `length`
variable only accounted for the value length without the single quotes.
2021-10-04 15:51:48 +02:00
Mahmoud Mandour
0e5b2c923d LibSQL: Add an INSERT without column names test
This adds a passing test of an insert statement that contains no column
names and assumes full tuple input
2021-10-04 15:51:48 +02:00
Mahmoud Mandour
235573f7ba LibSQL: Test INSERT statement with wrong number of values 2021-10-04 15:51:48 +02:00
Mahmoud Mandour
4df85840c3 LibSQL: Test INSERT statement with wrong data types 2021-10-04 15:51:48 +02:00
Mahmoud Mandour
6065383e05 LibSQL: Check NoError individually in execution tests
This enables tests to check that a statement is erroneous, we could not
do so by only calling `execute()` since it asserted that no errors
occurred.
2021-10-04 15:51:48 +02:00
Mahmoud Mandour
0906e3c206 LibSQL: Check data types in INSERT statement parsing
Data types are now checked against the table data types. When multiple
rows are inserted at once, we check all rows to be matching W.R.T data
types. Only then we insert the rows.
2021-10-04 15:51:48 +02:00
Mahmoud Mandour
f390478127 LibSQL: Parse INSERT statement without column names
This adds the ability to parse SQL INSERT statements in the following
form:

    INSERT INTO schema.tablename VALUES (column1, column2, ...),
                                        (column1, column2, ...), ...
2021-10-04 15:51:48 +02:00
Ali Mohammad Pur
64e231bd38 LibHTTP+LibGemini: Set underlying sockets as idle when detaching
This ultimately makes the sockets not spin while unused (particularly in
the 10s shutdown period that RequestServer's cache has).
2021-10-04 15:31:26 +02:00
Ali Mohammad Pur
29acb7fcf8 LibCore: Add a Socket::set_idle() API that turns the notifiers on/off
When a socket's user doesn't need it to be active, but wants to keep it
open, the socket's notifiers should not be enabled to avoid hogging the
CPU with effectively useless notifications.
This API can be used to disable said notifiers until the user needs the
notifications.
2021-10-04 15:31:26 +02:00
Ali Mohammad Pur
830b0e8f2d LibHTTP: Treat EOF on a non-Finished state as an error 2021-10-04 15:31:26 +02:00
Tobias Christiansen
873e95cb6a LibWeb: Flexbox: Care more about cross-axis margins
Auto margins are still not supported at all, but this is a good start
into supporting margins on flex items.
The way cross-before (top for row, left for column) is handled is very
naive.
2021-10-04 13:59:28 +02:00
Tobias Christiansen
9af85881f5 LibWeb: Flexbox: Take parents' specified main size into account
Previously, if the parent of the container had a definite main size, it
would've been disregarded when calculating the main size of the
container if it had no definite size and neither min- nor max-main-size
constraints.
This patch fixes that behavior by additionally checking whether the main
size is not only not constrained but also infinite.
2021-10-04 13:35:36 +02:00
Ali Mohammad Pur
fdd2d49c5b LibHTTP: Ignore empty reads on chunk boundaries 2021-10-04 13:06:03 +02:00
Ali Mohammad Pur
3564e4eff1 LibHTTP: Consider a job failed if its body fails decompression
Our previous behaviour of treating the original invalid compressed body
as the decompressed response is quite silly, if the headers and response
doesn't match up, the job has failed.
2021-10-04 13:06:03 +02:00
Tobias Christiansen
6e58b71c83 Meta: Add myself to the mailmap 2021-10-04 12:03:53 +01:00
Andreas Kling
bf43b0f884 LibWeb: Make IDL-constructed objects aware of their JS wrapper
Having IDL constructors call FooWrapper::create(impl) directly was
creating a wrapper directly without telling the impl object about the
wrapper. This meant that we had wrapped C++ objects with a null
wrapper() pointer.
2021-10-04 12:13:25 +02:00
Andreas Kling
643e2dec2c LibWeb: Make WindowObject::clear_interval() call correct function
This was incorrectly calling DOM::Window::clear_timeout(). In practice,
these functions are interchangeable, but let's have things looking
correct regardless.
2021-10-04 12:13:25 +02:00
Tim Schumacher
7af7fc8c16 Everywhere: Fix more Copyright header inconsistencies 2021-10-04 11:10:09 +01:00
Ali Mohammad Pur
e112e6620f LibCore: Allow reads smaller than the buffered data size in IODevice
This restriction doesn't make much sense, a user should be free to
consume the buffered data with as small a max_size as they desire.
This fixes a possible RequestServer spin when talking to HTTP servers.
2021-10-04 11:00:44 +02:00
Linus Groh
7ee3432ab6 LibWeb: Add basic support for script string argument to setInterval()
Instead of passing a function it is also possible to pass a string,
which is then evaluated as a classic script.
2021-10-04 09:54:24 +01:00
Linus Groh
9f4ac38f08 LibWeb: Add basic support for script string argument to setTimeout()
Instead of passing a function it is also possible to pass a string,
which is then evaluated as a classic script.

This means we now support the following example from the "timer
initialization steps", step 16 - except that it runs the timers in
reverse order, so the `log` result is `"TWO ONE "`.

https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timer-initialisation-steps

    var log = '';
    function logger(s) { log += s + ' '; }

    setTimeout({ toString: function () {
      setTimeout("logger('ONE')", 100);
      return "logger('TWO')";
    } }, 100);
2021-10-04 09:54:24 +01:00
Linus Groh
32b620c62d LibJS: Convert atomic_compare_exchange_impl() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
74e29fa60b LibJS: Convert perform_atomic_operation() to ThrowCompletionOr 2021-10-04 09:52:15 +01:00
Linus Groh
f95560b21a LibJS: Convert atomic_read_modify_write() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
6cef1dfa6d LibJS: Convert validate_atomic_access() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
12ac2338aa LibJS: Convert validate_integer_typed_array() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
253d9a38d1 LibJS: Convert typed_array_create() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
04ff12740c LibJS: Convert initialize_typed_array_from_list() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
d551e0e55e LibJS: Convert init_typed_array_from_array_like() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
8e3957767e LibJS: Convert init_typed_array_from_typed_array() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00
Linus Groh
7f86c32d62 LibJS: Convert init_typed_array_from_array_buffer() to ThrowCompletionOr
Also add spec step comments to it while we're here.
2021-10-04 09:52:15 +01:00