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;
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;
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;
}