Server 0.0.1
HTTP/REST server implementation

src/cbuf/write.c

Go to the documentation of this file.
00001 
00023 #include <sys/types.h>
00024 #include <unistd.h>
00025 
00026 #include "cbuf.h"
00027 #include "stream.h"
00028 
00029 
00030 ssize_t
00031 cbufWrite(Cbuf this, Stream st)
00032 {
00033         ssize_t wwsize = 0;
00034         size_t  wsize  = this->bused;
00035 
00036         if (0 == wsize) return 0;
00037 
00038         wwsize = streamWrite(st, cbufGetRead(this), wsize);
00039 
00040         switch (wwsize) {
00041                 case -1:
00042                         break;
00043 
00044                 default:
00045                         cbufIncRead(this, wwsize);
00046                         break;
00047         }
00048 
00049         return wwsize;
00050 }
00051 
00052 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines