quite some changes to http server code

This commit is contained in:
2020-05-16 19:12:10 +00:00
parent 98e2838edf
commit 619a7dd318
8 changed files with 513 additions and 260 deletions

View File

@ -1,3 +1,7 @@
#!/bin/sh
echo "Content-Type: text/plain"
echo "Custom-Attribute: abcdef"
echo
exec cat /home/hyung-hwan/projects/hawk/lib/run.c

View File

@ -4,12 +4,12 @@ BEGIN {
x = sys::socket (sys::AF_INET, sys::SOCK_STREAM, 0);
sys::connect (x, "127.0.0.1:9988");
msg = b"GET /home/hyung-hwan/projects/mio/bld/b.sh HTTP/1.0\r\n\
msg = b"GET /home/hyung-hwan/projects/mio/t/b.sh HTTP/1.1\r\n\
Host: www.google.com\r\n\
Connection: Keep-Alive\r\n\r\n";
sys::write (x, msg);
while (sys::read (x, buf) >= 0) printf ("%s", buf);
while (sys::read (x, buf) > 0) printf ("%s", buf);
sys::close (x);
}