Age | Commit message (Collapse) | Author |
|
This commit converts TLS::TLSv12 to a Core::Stream object, and in the
process allows TLS to now wrap other Core::Stream::Socket objects.
As a large part of LibHTTP and LibGemini depend on LibTLS's interface,
this also converts those to support Core::Stream, which leads to a
simplification of LibHTTP (as there's no need to care about the
underlying socket type anymore).
Note that RequestServer now controls the TLS socket options, which is a
better place anyway, as RS is the first receiver of the user-requested
options (though this is currently not particularly useful).
|
|
These look much nicer than these repeated ternaries :^)
|
|
You now cannot get an unconnected LibIMAP::Client, but you can still
close it. This makes for a nicer API where we don't have a Client object
in a limbo state between being constructed and being connected.
This code still isn't as nice as it should be, as TLS::TLSv12 is still
not a Core::Stream::Socket subclass, which would allow for consolidating
most of the TLS/non-TLS code into a single implementation.
|
|
|
|
|
|
This removes the awkward String::replace API which was the only String
API which mutated the String and replaces it with a new immutable
version that returns a new String with the replacements applied. This
also fixes a couple of UAFs that were caused by the use of this API.
As an optimization an equivalent StringView::replace API was also added
to remove an unnecessary String allocations in the format of:
`String { view }.replace(...);`
|
|
Our existing implementation did not check the element type of the other
pointer in the constructors and move assignment operators. This meant
that some operations that would require explicit casting on raw pointers
were done implicitly, such as:
- downcasting a base class to a derived class (e.g. `Kernel::Inode` =>
`Kernel::ProcFSDirectoryInode` in Kernel/ProcFS.cpp),
- casting to an unrelated type (e.g. `Promise<bool>` => `Promise<Empty>`
in LibIMAP/Client.cpp)
This, of course, allows gross violations of the type system, and makes
the need to type-check less obvious before downcasting. Luckily, while
adding the `static_ptr_cast`s, only two truly incorrect usages were
found; in the other instances, our casts just needed to be made
explicit.
|
|
|
|
|
|
Problem:
- New `all_of` implementation takes the entire container so the user
does not need to pass explicit begin/end iterators. This is unused
except is in tests.
Solution:
- Make use of the new and more user-friendly version where possible.
|
|
Parse it to avoid dbgln() spam, but ignore the value for now. See:
https://datatracker.ietf.org/doc/html/rfc4551#section-3.1.1
|
|
In my case the mail server responded with the following after selecting
a mailbox (in the Mail application):
* OK [CLOSED] Previous mailbox closed.
* FLAGS (\Answered \Flagged ...)
* OK [PERMANENTFLAGS (\Answered \Flagged ... \*)] Flags permitted.
* 2 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1234567890] UIDs valid
* OK [UIDNEXT 12345] Predicted next UID
* OK [HIGHESTMODSEQ 123456] Highest
A6 OK [READ-WRITE] Select completed (0.002 secs).
The [CLOSED] part threw the parser off as it was expecting a space after
the atom following the opening bracket, which would actually lead to a
crash of Mail (AK::Optional::value() without value).
|
|
matches() is for globs. These are not globs.
|
|
|
|
Move members after methods, remove useless parameter names ('x', 's'),
more sensible method grouping.
|
|
This isn't parsing anything.
|
|
These were putting the raw string values into the command, where they
should be astrings as per the grammar:
https://datatracker.ietf.org/doc/html/rfc3501#section-9
|
|
This makes it so we can use Optional instead of relying on an error
number.
|
|
|
|
|
|
This is a very common encoding for e-mail. Gmail seems to encode all
HTML e-mail in it.
imap qp clang
|
|
This makes Promise available without having to link LibIMAP.
|
|
These include APPEND, AUTHENTICATE, CHECK, CLOSE, EXAMINE, EXPUNGE,
LSUB, SUBSCRIBE, UNSUBSCRIBE
|
|
|
|
|
|
|
|
|
|
This completes the implementation of the FETCH command.
|
|
This commit doesn't include support for FETCH BODY, because it's a bit
big already. Rest assured, FETCH is the most complicated IMAP command,
and we'll go back to simple boring ones shortly.
|
|
|
|
|
|
|
|
This involves parsing messages with untagged responses
|
|
A large commit, but sets up the framework for how the IMAP library will
work. Right now only the NOOP command and response is supported.
|