diff options
-rw-r--r-- | server.c | 8 | ||||
-rw-r--r-- | types.h | 1 |
2 files changed, 7 insertions, 2 deletions
@@ -127,12 +127,15 @@ void server_setHomeAttribute(const char *server, const char *homeattribute) server_t *entry = server_create(server); if (entry == NULL || entry->sslContext != NULL) return; free((void*)entry->homeAttr.s); + free((void*)entry->homeAttrLower.s); entry->homeAttr.l = strlen(homeattribute); + entry->homeAttrLower.l = entry->homeAttr.l; + entry->homeAttr.s = strdup(homeattribute); char *tmp = strdup(homeattribute); - for (size_t i = 0; i < entry->homeAttr.l; ++i) { + for (size_t i = 0; i < entry->homeAttrLower.l; ++i) { tmp[i] = tolower(tmp[i]); } - entry->homeAttr.s = tmp; + entry->homeAttrLower.s = tmp; } void server_setFingerprint(const char *server, const char *fingerprint) @@ -440,6 +443,7 @@ BOOL server_send(epoll_server_t *server, const char *buffer, size_t len, const B server->kill = TRUE; return FALSE; } + server->lastActive = time(NULL); if (ret == (int)len) return TRUE; // Couldn't send everything, continue with buffering logic below if (ret > 0) { @@ -106,6 +106,7 @@ struct _server_t_ { char sid[SIDLEN]; char homeTemplate[MOUNTLEN]; struct string homeAttr; + struct string homeAttrLower; unsigned char fingerprint[FINGERPRINTLEN]; char cabundle[MAXPATH]; BOOL plainLdap; |