profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/vojta7/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

vojta7/aoc2020 1

advent of code 2020

vojta7/miniserve 1

:star2: For when you really just want to serve some files over HTTP right now!

vojta7/paru 1

AUR helper based on yay

vojta7/merecat 0

Small and made-easy HTTP/HTTPS server based on Jef Poskanzer's thttpd

vojta7/pra-lang 0

Simple language interpreter

vojta7/pra-lang-front-end 0

Web editor for pra lang.

vojta7/rltk_rs 0

The Roguelike Toolkit (RLTK), implemented for Rust.

vojta7/rust-openssl 0

OpenSSL bindings for Rust

vojta7/rustrogueliketutorial 0

Roguelike Tutorial in Rust - using RLTK

vojta7/sorting-visualization 0

Visualization of sorting algorithms

startedrg3dengine/rg3d

started time in a month

startedrillrate/rillrate

started time in a month

issue commentcrossterm-rs/crossterm

Clicking in Windows Terminal v1.9.1942.0 causes a panic due to an unhandled event flag

Even though Microsoft documentation doesn't mention it, the value of dwEventFlags clearly looks like bitflags that can be ORed together.

I tried to look into commits of Microsoft terminal and I think that this commit might introduce this behavior.

This method also looks interesting, it creates eventFlags in a way that multiple values can be present.

ClementTsang

comment created time in 2 months

push eventvojta7/merecat

Vojtech Pejsa

commit sha 4867f1de4bb9163430d85ee6ba843715262b3012

Fix indentation.

view details

push time in 2 months

push eventvojta7/merecat

Vojtech Pejsa

commit sha eb03533e92c2140ce381a99f39a14092f09ccf7c

Fix memory leaks.

view details

push time in 2 months

push eventvojta7/merecat

Vojtech Pejsa

commit sha 73574f9aa021992e5922ca138894f00df8f18240

Fix memory leaks.

view details

push time in 2 months

pull request commenttroglobit/merecat

Normalize http header line endings to always be \r\n

I am not really sure how to make it simpler, so I think I will have to wait for your rewrite.

I can fix the memory leak introduced by me quite easily, but I didn't do it because in cgi_interpose_output there is exactly the same problem in the original code (newly allocated headers), so I thought it is intentional. If it would improve this merge request I can fix both leaks, it would be just 2 calls to free.

vojta7

comment created time in 2 months

PR opened troglobit/merecat

Normalize http header line endings to always be \r\n

This PR should fix #26.

Implementation is much more complex than I originally thought, but I found no better way how to implement this. I tested it with CGI scripts producing both types of line ends and run it under address sanitizer and it seems to work well, but I am not really confident in my ability to write correct C.

This implementation causes a memory leak, but since it is run in a short-lived forked process and this seems to be the intended coding style I didn't try to free newly allocated memory.

+71 -0

0 comment

1 changed file

pr created time in 2 months

create barnchvojta7/merecat

branch : normalize-headers

created branch time in 2 months

fork vojta7/merecat

Small and made-easy HTTP/HTTPS server based on Jef Poskanzer's thttpd

https://troglobit.com/projects/merecat/

fork in 2 months

issue openedtroglobit/merecat

HTTP header line endings

Hi,

I recently discovered the merecat is sending an HTTP response in the following format:

HTTP/1.0 200 OK\r\n
Content-type: text/html\n
\n

The status line is correctly ended with '\r\n', but the content-type header and the newline separating headers and body is '\n'. The Unix line endings are produced by my CGI script. I can fix this on the CGI script side, but accord to CGI RFC it seems that CGI servers are supposed to do the translation from native line ends to '\r\n'.

I think that it can be implemented in libhttp.c when interposing cgi_output after the test that headers aren't empty. Would you be willing to add this change? If necessary I can implement it and send PR.

created time in 2 months