Server 0.0.1
HTTP/REST server implementation

src/server/close_conn.c

Go to the documentation of this file.
00001 
00023 #include <stdlib.h>
00024 #include <string.h>
00025 
00026 #include "server.h"
00027 #include "class.h"
00028 #include "stream.h"
00029 
00030 void
00031 serverCloseConn(Server this, unsigned int i)
00032 {
00033         int    fd = (this->fds)[i].fd;
00034         Stream st = (this->conns[fd]).stream;
00035 
00036         delete((this->conns)[fd].sock);
00037         delete((this->conns)[fd].worker);
00038 
00039         if (NULL != st && STREAM_SSL == st->type) {
00040                 SSL_shutdown((st->handle).ssl);
00041                 SSL_free((st->handle).ssl);
00042         }
00043 
00044         delete(st);
00045 
00046         memset(&(this->fds[i]), 0, sizeof(struct pollfd));
00047 }
00048 
00049 // vim: set ts=4 sw=4:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines