Server 0.0.1
HTTP/REST server implementation

src/http/writer.c

Go to the documentation of this file.
00001 
00023 #include <stdarg.h>
00024 
00025 #include "class.h"
00026 #include "stream.h"
00027 
00028 #include "http/message/queue.h"
00029 #include "http/writer.h"
00030 
00031 static
00032 int
00033 httpWriterCtor(void * _this, va_list * params)
00034 {
00035         HttpWriter this = _this;
00036 
00037         this->buffer = va_arg(*params, Cbuf);
00038         this->queue  = new(HttpMessageQueue);
00039 
00040         return 0;
00041 }
00042 
00043 static
00044 void
00045 httpWriterDtor(void * _this)
00046 {
00047         HttpWriter this = _this;
00048 
00049         delete(this->queue);
00050 
00051         if (TRUE == this->ourLock)
00052                 cbufRelease(this->buffer);
00053 
00054         if (NULL != this->current)
00055                 delete(this->current);
00056 }
00057 
00058 INIT_IFACE(Class, httpWriterCtor, httpWriterDtor, NULL);
00059 INIT_IFACE(StreamWriter, httpWriterWrite);
00060 CREATE_CLASS(HttpWriter, NULL, IFACE(Class), IFACE(StreamWriter));
00061 
00062 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines