5 ms·
> basic 1300 lines... also, the line numbers dont actually align with the lines: https://git.kernel.dk/cgit/liburing/tree/examples/proxy.c#n1303 https://git.
by 38 3y ago
> basic
1300 lines...
also, the line numbers dont actually align with the lines:
https://git.kernel.dk/cgit/liburing/tree/examples/proxy.c#n1303 https://git.kernel.dk/cgit/liburing/tree/examples/proxy.c#n1...
- o11c 3y agoFWIW it's about 800 lines excluding comments. and yeah, this is why you don't abuse side-by-side divs ... actually, that's a table ... and instead just make your number unselectable (there are several ways to do this).
- packetlost 3y agoThat's pretty small for a complete C application...
- userbinator 3y ago[flagged]
- deleted 3y ago[deleted]
- rogers12 3y agoYou should go back and add error handling to your C programs
- userbinator 3y agoAre you implying I don't already have error handling? Personal insults are not acceptable here.
- verticalscaler 3y agoMy dude, how would he know better? It is a perfectly fair assumption given the average C code base. Those numbers are unusually succinct. You sound like you really know what you're doing, if you can, please share some of this for our edification and don't take things personally.
- znpy 3y ago> Are you implying I don't already have error handling? With baseless claims, no code, no other consideration? I would not imply that, I would assume that.
- lionkor 3y agopost your code
- littlestymaar 3y agoHow is a codec a complete application?
- unmole 3y agoTalk is cheap, show me the code.
- znpy 3y agocame to write the same thing. take my upvote.
- secondcoming 3y agoYour 200 line TCP proxy is likely to be very inefficient. This is what things like DPDK and io_uring attempt to solve.
- sophacles 3y agoSo your 200 line proxy... I wonder how it performs compared to this. Since LOC is a silly measure of anything, lets use it further: How many bytes/s/sloc does yours acheive compared to the io_uring one?
- Fischgericht 3y agoOr people have no respect for arrogant boasting. Also, you most likely are a liar. Just the matrix tables you need for MPEG-1 are 500+ lines. Unless of course you used 1100 lines to call ffmpeg. Then you don't need the tables. But that being said: Yes, writing a TCP proxy in 200 lines is indeed possible. But it will use standard socket calls. You might want to read up about what io_uring is all about, and why it's worth going the extra mile. Or, as an alternative, you could STFU :)
- jeroenhd 3y agoIt aligns perfectly for me. Must've been mostly tested on Firefox.
- rwiggins 3y agoThere's something super weird going on with those line numbers. They don't align for me either (Firefox on Windows 11). In the web inspector, the line numbers are rendering with Courier New as the font, whereas the code itself is `monospace`. The weird thing is both are controlled by a single CSS rule, div#cgit pre { font-family: "Source Code Pro", "Courier New", monospace; } (Changing to just `monospace` fixes it.) I'm not sure how two elements could have different fonts with that. I'm possibly missing something obscure, but it really feels like a browser bug.
- hddqsb 3y agoGreat sleuthing, the missing piece of the puzzle is that the file contents are inside a <code> element while the line numbers are not, and <code> elements have a default font so they don't inherit the font from their parent element. Changing the selector to the following fixes the issue: div#cgit pre, div#cgit code { ... } (The buggy CSS is not present in the the official cgit repository, so I assume the owner of kernel.dk is running a patched version of cgit.)