+ if(event_initialized(&c->outevent))
+ event_del(&c->outevent);
+
+ if(c->socket > 0)
+ closesocket(c->socket);
+
+ c->socket = -1;
+
+ c->protocol_major = 0;
+ c->protocol_minor = 0;
+ c->allow_request = 0;
+}
+
+void free_connection(connection_t *c) {
+ if(!c)
+ return;
+
+ free_connection_partially(c);
+
+ free(c->name);
+ free(c->hostname);
+
+ if(c->config_tree)
+ exit_configuration(&c->config_tree);
+