-rw-r--r-- | include/sitecing/sitecing_interface_cgi.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/include/sitecing/sitecing_interface_cgi.h b/include/sitecing/sitecing_interface_cgi.h index cab947c..da538d6 100644 --- a/include/sitecing/sitecing_interface_cgi.h +++ b/include/sitecing/sitecing_interface_cgi.h @@ -33,30 +33,51 @@ namespace sitecing { * The list of headers to spit out. */ headers_t headers; /** * Here is where we prebuffer output. */ - ostringstream prebuffer; + stringbuf prebuffer; + /** + * Output stream, initially going to prebuffer. + */ + ostream outs; + /** + * Have headers been sent yet? + */ + bool headers_flushed; /** * Pointer to the sitespace object. */ sitespace *ss; // XXX: or does it belong to the generic interface? or should this 'generic' interface exist at all? /** * @param s Pointer to the sitespace object. */ sitecing_interface_cgi(sitespace *s); /** - * @todo TODO: wish I could remember -- document me. + * Set up interface for the (possibly, new) cgi gateway object, + * reset headers, empty buffer, etc. */ void prepare(kingate::cgi_gateway *cg); /** - * @todo TODO: wish I could remember -- document me. + * Flush output stream. + */ + void flush(bool keep_buffering=false); + /** + * Send headers to the output stream, if we haven't yet. + */ + void flush_headers(); + /** + * Are we buffering now? + */ + bool is_buffering(); + /** + * Control output buffering. */ - void flush(); + void set_buffering(bool do_buffer); }; } #endif /* __SITECING_SITECING_INTERFACE_CGI_H */ |