1 /* Simplest possible example of a shared object script.
2 * - by Richard W.M. Jones <rich@annexia.org>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the Free
16 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 * $Id: hello.c,v 1.3 2002/12/01 16:16:04 rich Exp $
21 #include "rws_request.h"
24 handle_request (rws_request rq)
26 http_request http_request = rws_request_http_request (rq);
27 io_handle io = rws_request_io (rq);
30 http_response http_response;
33 http_response = new_http_response (pth_get_pool (current_pth),
36 http_response_send_headers (http_response,
38 "Content-Type", "text/plain",
41 close = http_response_end_headers (http_response);
43 if (http_request_is_HEAD (http_request)) return close;
45 io_fprintf (io, "hello, world!");