Commit 5c1c6a80cf88cc6ecc244669e87eb21ad274a1e8
1 parent
6550e381
some more cleanups in the server code. Removing not needed header includes
Showing
4 changed files
with
32 additions
and
27 deletions
| 1 | +2012-02-15 12:30:33 +0100 Georg Hopp | |
| 2 | + | |
| 3 | + * some more cleanups in the server code. Removing not needed header includes (HEAD, master) | |
| 4 | + | |
| 5 | +2012-02-15 12:17:39 +0100 Georg Hopp | |
| 6 | + | |
| 7 | + * Merge branch 'master' of 192.168.100.2:/var/lib/git/server (origin/master, origin/HEAD) | |
| 8 | + | |
| 1 | 9 | 2012-02-15 12:17:00 +0100 Georg Hopp |
| 2 | 10 | |
| 3 | - * now the separated http worker works. Changed some size_t to ssize_t as i use -1 and -2 es error indicator in my server and fixed caculation of remainig buffer size in reader (HEAD, master) | |
| 11 | + * now the separated http worker works. Changed some size_t to ssize_t as i use -1 and -2 es error indicator in my server and fixed caculation of remainig buffer size in reader | |
| 4 | 12 | |
| 5 | 13 | 2012-02-15 09:38:32 +0100 Georg Hopp |
| 6 | 14 | |
| ... | ... | @@ -10,6 +18,10 @@ |
| 10 | 18 | |
| 11 | 19 | * add subject/observer interface |
| 12 | 20 | |
| 21 | +2012-02-15 06:19:52 +0100 Georg Hopp | |
| 22 | + | |
| 23 | + * add subject/observer interface | |
| 24 | + | |
| 13 | 25 | 2012-02-15 04:55:46 +0100 Georg Hopp |
| 14 | 26 | |
| 15 | 27 | * fix infinite busy loop in run | ... | ... |
| 1 | +#include <errno.h> | |
| 2 | + | |
| 1 | 3 | static |
| 2 | 4 | int |
| 3 | 5 | serverHandleAccept(Server this) |
| ... | ... | @@ -19,6 +21,20 @@ serverHandleAccept(Server this) |
| 19 | 21 | this->nfds++; |
| 20 | 22 | } else { |
| 21 | 23 | delete(&acc); |
| 24 | + | |
| 25 | + switch(errno) { | |
| 26 | + case EAGAIN: | |
| 27 | + loggerLog(this->logger, | |
| 28 | + LOGGER_DEBUG, | |
| 29 | + "server accept blocks"); | |
| 30 | + break; | |
| 31 | + | |
| 32 | + default: | |
| 33 | + loggerLog(this->logger, | |
| 34 | + LOGGER_DEBUG, | |
| 35 | + "server accept error"); | |
| 36 | + break; | |
| 37 | + } | |
| 22 | 38 | } |
| 23 | 39 | |
| 24 | 40 | return (acc)? acc->handle : -1; | ... | ... |
| 1 | -#include <poll.h> /* for poll system call and related */ | |
| 2 | -#include <string.h> /* for memset and stuff */ | |
| 3 | -#include <stdlib.h> /* for exit */ | |
| 4 | -#include <errno.h> /* for errno */ | |
| 5 | -#include <unistd.h> | |
| 6 | -#include <ctype.h> | |
| 7 | -#include <time.h> | |
| 8 | -#include <errno.h> | |
| 9 | -#include <fcntl.h> | |
| 10 | -#include <sys/types.h> | |
| 11 | -#include <sys/stat.h> | |
| 12 | - | |
| 13 | 1 | #include "server.h" |
| 14 | 2 | #include "socket.h" |
| 15 | 3 | #include "logger.h" |
| ... | ... | @@ -64,20 +52,6 @@ serverRun(Server this) |
| 64 | 52 | if (this->sock->handle == (this->fds)[i].fd) { |
| 65 | 53 | while(-1 != serverHandleAccept(this) && 0 < naccs) { |
| 66 | 54 | naccs--; |
| 67 | - | |
| 68 | - switch(errno) { | |
| 69 | - case EAGAIN: | |
| 70 | - loggerLog(this->logger, | |
| 71 | - LOGGER_DEBUG, | |
| 72 | - "server accept blocks"); | |
| 73 | - break; | |
| 74 | - | |
| 75 | - default: | |
| 76 | - loggerLog(this->logger, | |
| 77 | - LOGGER_DEBUG, | |
| 78 | - "server accept error"); | |
| 79 | - break; | |
| 80 | - } | |
| 81 | 55 | } |
| 82 | 56 | } |
| 83 | 57 | ... | ... |
Please
register
or
login
to post a comment