Server 0.0.1
HTTP/REST server implementation

include/http/writer.h

Go to the documentation of this file.
00001 
00024 #ifndef __HTTP_WRITER_H__
00025 #define __HTTP_WRITER_H__
00026 
00027 #include <sys/types.h>
00028 
00029 #include "class.h"
00030 #include "http/message.h"
00031 #include "http/message/queue.h"
00032 #include "cbuf.h"
00033 #include "stream.h"
00034 
00035 #include "commons.h"
00036 
00037 
00038 #define WRITER_MAX_BUF  131072
00039 
00040 
00041 typedef enum e_HttpWriterState {
00042         HTTP_WRITER_GET=0,
00043         HTTP_WRITER_WRITE,
00044         HTTP_WRITER_DONE
00045 } HttpWriterState;
00046 
00047 CLASS(HttpWriter) {
00048         Cbuf             buffer;
00049         Bool             ourLock;
00050 
00051         HttpMessageQueue queue;
00052         HttpMessage      current;
00053 
00054         size_t           nheader;
00055         size_t           nbody;
00056         size_t           written;
00057 
00058         HttpWriterState  state;
00059 };
00060 
00061 ssize_t httpWriterWrite(void *, Stream);
00062 
00063 #endif // __HTTP_WRITER_H__
00064 
00065 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines