You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
993 B
39 lines
993 B
#include <stdlib.h> /* for free() */
|
|
#include <unistd.h> /* for close() */
|
|
#include <sys/socket.h> /* for shutdown() */
|
|
#include <string.h> /* for memset and stuff */
|
|
|
|
#include <expat.h>
|
|
|
|
#include "../../include/client.h"
|
|
#include "../../include/monitor.h"
|
|
#include "../../include/httpRequest.h"
|
|
|
|
void clientClose(tClient * client)
|
|
{
|
|
if (0 != verbose) {
|
|
syslog(LOG_INFO, "closing socket for %s", client->remoteAddr);
|
|
}
|
|
|
|
/* close socket an remove from fd_set */
|
|
shutdown(client->socket, SHUT_RDWR);
|
|
close(client->socket);
|
|
|
|
/* free readBuffer */
|
|
if (NULL != client->readBuffer) {
|
|
free(client->readBuffer);
|
|
client->readBuffer = NULL;
|
|
}
|
|
if (NULL != client->writeBuffer) {
|
|
free(client->writeBuffer);
|
|
client->writeBuffer = NULL;
|
|
}
|
|
client->readPos = 0;
|
|
client->writePos = 0;
|
|
|
|
freeHttpHeader(&(client->httpHeader));
|
|
|
|
XML_ParserFree(client->parser);
|
|
|
|
memset(client->remoteAddr, 0, 16);
|
|
}
|