Web++: A C++ Web Framework
132 subscribers
440 photos
36 videos
20 files
177 links
Web++ Framework (A C++ web framework to ease the pain of web development)

Using modern C++20/23.
GitHub: https://github.com/the-moisrex/webpp

I've been working on this project since 2019...
Download Telegram
Turns out my IPv6 Parser implementation can correctly parse IPv4s, but it shouldn't, raw valid IPv4s are not valid IPv6s. πŸ˜…
Browsers make mistakes too

There are a few bugs with the current implementation of URL Parser for firefox. (Chromium has them too, but that's another bug).


This URL:
http://127.0.0.1/..//./one/%2E./%2e/two/././././%2e/%2e/.././three/four/%2e%2e/five/.%2E/%2e


Should be equal to this URL (from ada-url):
http://127.0.0.1//three/
| | |
| | `------- pathname_start 16
| | `------- host_end 16
| `---------------- host_start 7
| `---------------- username_end 7
`------------------ protocol_end 5


I'm writing a WHATWG-compliant URL Parser, so that's why I'm noticing these kinda stuff.


It seems like URL parser of Firefox has a bug which doesn't decode the last segment of the path for some reason.

For example,
http://localhost/page/%2e%2e
is just
http://localhost/
YES, my tests are failing successfully; no crashes anymore. 😁
Did you know these two are VALID URLs and are the SAME?

file://C|\windows

file:///C:/windows
😐1
Web++: A C++ Web Framework
Did you know you couldn't use hex numbers as IPv4 octets, but you kinda can? In WHATWG compliant URL Parsers, it's a warning, not an error: Β» http://127.0.0x10.1 is same as: Β» http://127.0.16.1 I don't agree with this decision though, and also it messes…
All of these URLs refer to the same place:

http://127.0.0.1/
http://0x7F.1/
http://0x7F000001
http://0x0000000007F.0X1
http://127.0.0x0.1
http://127.0X0.0x0.1
http://127.0X0.0x0.0x1
http://127.0.0x0.0x0000000000000000000000000000000000000000000000000000000000000001
http://0x7F.0x00000000000000000000000001
http://0x000000000000000007F.0x00000000000000000000000001
http://0x000000000000000007F.0.0x00000000000000000000000001
http://0x7F.0.0.0x1
http://0x7F.0.0x000.0x1
http://2130706433
http://127.1
http://127.0x00.1
http://127.0x000000000000000.0.1

😐😐😐😐😐
πŸ€”1
file://β˜•οΈ.why/is/this/a/valid/URI/,/WHY?
Use clang-format, they said!


Updated my .clang-format and ran it on all the files, it broke a lot of things.
I had to spend hours going through all the changes one by one.

After doing this, I surprised myself; I didn't expect to have written this much code over the past few years.

Turns out I missed some bugs: the issue
My tests are crashing,

- but only in clang, (reasonable, right?)
- and not if each unit test run individually (but, how??)

How does it know I'm filtering the tests?

Truth will prevail after I force some gdb/lldb serum down its throat.
πŸ‘1πŸ‘€1
Don't even ask!

polymorphic_allocator< std::allocator<char> >
😁2
Am I wrong, or it's clang-tidy?

Satisfying solution for this: πŸ™ƒ
// NOLINT(*-rvalue-reference-param-not-moved)
2 problems with using standard containers with stack-based allocators:

1. No allocator, or resource exists for it that's not monotonic (monotonic_buffer_resource that actually deallocates)

2. Containers allocate more than needed, thus making it hard to guess the stack size

Writing a memory resource like monotonic_buffer_resource that does deallocate is not that hard (I might write one), so the first problem is easily resolvable.

But for the second problem, any solve for that requires knowledge of the containers being used which means tightly coupling the containers with the stack size being used which is not a good solution in my opinion.

What do you think?

Compiler Explorer link 1
Compiler Explorer link 2