X-Git-Url: http://git.pk910.de/?p=TransparentIRC.git;a=blobdiff_plain;f=src%2FIOHandler.c;h=1843accb8f9cde95a5b25daab8827ce8677b3c10;hp=375bcea86e3a20e8196114a33cbf6f3bbdd47df2;hb=8889b0aee1dc430e735e2a0df462fd0aeee63847;hpb=4fdc419424dd18df5807ed4218a84fa38e1dd6f6 diff --git a/src/IOHandler.c b/src/IOHandler.c index 375bcea..1843acc 100644 --- a/src/IOHandler.c +++ b/src/IOHandler.c @@ -106,7 +106,7 @@ struct IODescriptor *iohandler_timer(struct timeval timeout, iohandler_callback return descriptor; } -struct IODescriptor *iohandler_connect(const char *hostname, unsigned int port, const char *bindhost, iohandler_callback *callback) { +struct IODescriptor *iohandler_connect(const char *hostname, unsigned int port, int ssl, const char *bindhost, iohandler_callback *callback) { //non-blocking connect int sockfd; struct addrinfo hints, *res, *freeres; @@ -216,7 +216,7 @@ struct IODescriptor *iohandler_connect(const char *hostname, unsigned int port, return descriptor; } -struct IODescriptor *iohandler_listen(const char *hostname, unsigned int port, iohandler_callback *callback) { +struct IODescriptor *iohandler_listen(const char *hostname, unsigned int port, int ssl, iohandler_callback *callback) { int sockfd; struct addrinfo hints, *res, *freeres; struct sockaddr_in *ip4 = NULL; @@ -434,8 +434,10 @@ void iohandler_events(struct IODescriptor *iofd, int readable, int writeable) { if(used_bytes) { if(used_bytes == iofd->readbuf.bufpos) iofd->readbuf.bufpos = 0; - else + else { memmove(iofd->readbuf.buffer, iofd->readbuf.buffer + used_bytes, iofd->readbuf.bufpos - used_bytes); + iofd->readbuf.bufpos -= used_bytes; + } } callback_event.type = IOEVENT_IGNORE; }