Browse Source

only code format changes

release0.1.5
Georg Hopp 12 years ago
parent
commit
7ce2adf1fe
  1. 2
      src/http/parser/parse.c
  2. 10
      src/server/server.c

2
src/http/parser/parse.c

@ -83,7 +83,7 @@ httpParserParse(void * _this, Stream st)
case HTTP_MESSAGE_START: case HTTP_MESSAGE_START:
if (NULL == (line = cbufGetLine(this->buffer, &line_end))) { if (NULL == (line = cbufGetLine(this->buffer, &line_end))) {
if (! cbufIsEmpty(this->buffer)) { if (! cbufIsEmpty(this->buffer)) {
this->isize = this->buffer->bused;
this->isize = this->buffer->bused;
this->incomplete = malloc(this->isize); this->incomplete = malloc(this->isize);
memcpy(this->incomplete, memcpy(this->incomplete,
cbufGetData(this->buffer, this->isize), cbufGetData(this->buffer, this->isize),

10
src/server/server.c

@ -61,15 +61,15 @@ serverCtor(void * _this, va_list * params)
port = va_arg(* params, int); port = va_arg(* params, int);
backlog = va_arg(* params, unsigned int); backlog = va_arg(* params, unsigned int);
this->fds = calloc(sizeof(struct pollfd), this->max_fds);
this->conns = calloc(sizeof(struct conns), this->max_fds);
this->fds = calloc(sizeof(struct pollfd), this->max_fds);
this->conns = calloc(sizeof(struct conns), this->max_fds);
this->sock = new(Sock, this->logger, port);
flags = fcntl(this->sock->handle, F_GETFL, 0);
this->sock = new(Sock, this->logger, port);
flags = fcntl(this->sock->handle, F_GETFL, 0);
fcntl(this->sock->handle, F_SETFL, flags | O_NONBLOCK); fcntl(this->sock->handle, F_SETFL, flags | O_NONBLOCK);
this->sockSSL = new(Sock, this->logger, port+1); this->sockSSL = new(Sock, this->logger, port+1);
flags = fcntl(this->sockSSL->handle, F_GETFL, 0);
flags = fcntl(this->sockSSL->handle, F_GETFL, 0);
fcntl(this->sockSSL->handle, F_SETFL, flags | O_NONBLOCK); fcntl(this->sockSSL->handle, F_SETFL, flags | O_NONBLOCK);
SSL_library_init(); SSL_library_init();

Loading…
Cancel
Save