Browse Source
this is a huge one...removed cbuf for writing again.... This is not needed any more because I use memory mapped io for these. Additionally sanitised write error handling somewhat...anyway, under huge load I still observer unexpected connection closes. But maybe this is related to interrupt while reading...(reading is not handled very well right now)
release0.1.5
this is a huge one...removed cbuf for writing again.... This is not needed any more because I use memory mapped io for these. Additionally sanitised write error handling somewhat...anyway, under huge load I still observer unexpected connection closes. But maybe this is related to interrupt while reading...(reading is not handled very well right now)
release0.1.5
13 changed files with 204 additions and 201 deletions
-
30include/http/writer.h
-
10include/utils/memory.h
-
2src/cbuf/Makefile.am
-
56src/cbuf/write.c
-
26src/http/worker.c
-
4src/http/worker/get_asset.c
-
3src/http/worker/process.c
-
13src/http/writer.c
-
129src/http/writer/write.c
-
33src/server/run.c
-
57src/server/write.c
-
24src/stream/write.c
-
18src/utils/memory.c
@ -1,56 +0,0 @@ |
|||
/** |
|||
* \file |
|||
* |
|||
* \author Georg Hopp |
|||
* |
|||
* \copyright |
|||
* Copyright © 2012 Georg Hopp |
|||
* |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|||
*/ |
|||
|
|||
#include <sys/types.h> |
|||
#include <unistd.h> |
|||
|
|||
#include "cbuf.h" |
|||
#include "stream.h" |
|||
|
|||
|
|||
ssize_t |
|||
cbufWrite(Cbuf this, Stream st) |
|||
{ |
|||
ssize_t wwsize = 0; |
|||
size_t wsize = this->bused; |
|||
|
|||
if (0 == wsize) return 0; |
|||
|
|||
wwsize = streamWrite(st, cbufGetRead(this), wsize); |
|||
|
|||
switch (wwsize) { |
|||
case 0: |
|||
wwsize = -2; |
|||
// DROP THROUGH |
|||
|
|||
case -1: |
|||
break; |
|||
|
|||
default: |
|||
cbufIncRead(this, wwsize); |
|||
break; |
|||
} |
|||
|
|||
return wwsize; |
|||
} |
|||
|
|||
// vim: set ts=4 sw=4: |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue