Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: othersrc/external/historical/eawk



Module Name:    othersrc
Committed By:   agc
Date:           Sat Jun  8 10:48:57 UTC 2013

Modified Files:
        othersrc/external/historical/eawk/extend: Makefile
Added Files:
        othersrc/external/historical/eawk/extend/httpd: Makefile httpd.c
            shlib_version tiny.c tiny.h
        othersrc/external/historical/eawk/scripts: httpd.sh json.sh

Log Message:
Changes to eawk:

+ add a small script to do some basic json printing

+ add a small http daemon library - which only does GET requests,
  but still useful. Also add an eawk script, which acts as a web server
  in 9 lines of awk:

        env LD_LIBRARY_PATH=lib:extend/httpd bin/eawk -v port=${port} '
        BEGIN { use("httpd")
                server = httpd_bind_server("localhost", port, "ipv4")
                while (1) {
                        client = httpd_get_connection(server);
                        uri = httpd_read_request(client);
                        filename = httpd_parse_uri(uri)
                        httpd_serve_static_content(client, filename);
                        httpd_close_client_connection(client);
                }
        }'

and in use:

% sh scripts/httpd.sh 12345
Client request from: 127.0.0.1
GET /CHANGES HTTP/1.0
Host: localhost:12345
Accept: text/html, text/plain, text/css, text/sgml, */*;q=0.01
Accept-Encoding: gzip, compress, bzip2
Accept-Language: en
User-Agent: Lynx/2.8.7rel.1 libwww-FM/2.14 SSL-MM/1.4.1 OpenSSL/1.0.1-stable


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 othersrc/external/historical/eawk/extend/Makefile
cvs rdiff -u -r0 -r1.1 \
    othersrc/external/historical/eawk/extend/httpd/Makefile \
    othersrc/external/historical/eawk/extend/httpd/httpd.c \
    othersrc/external/historical/eawk/extend/httpd/shlib_version \
    othersrc/external/historical/eawk/extend/httpd/tiny.c \
    othersrc/external/historical/eawk/extend/httpd/tiny.h
cvs rdiff -u -r0 -r1.1 othersrc/external/historical/eawk/scripts/httpd.sh \
    othersrc/external/historical/eawk/scripts/json.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index