summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/server.c b/server.c
index 9bf9e58..edde2ce 100644
--- a/server.c
+++ b/server.c
@@ -469,7 +469,7 @@ void server_free(epoll_server_t *server)
close(server->fd);
server->fd = -1;
}
- server->sbPos = server->sbFill = 0;
+ server->rbPos = server->sbPos = server->sbFill = server->bindLen = 0;
if (server->dynamic) {
printf("[Server] Freeing Bind-AD-Connection\n");
free(server->sendBuffer);
@@ -576,7 +576,7 @@ static void server_haveIn(epoll_server_t *server)
BOOL server_send(epoll_server_t *server, const char *buffer, size_t len, const BOOL cork)
{
if (server->kill) return FALSE;
- if (server->ssl == NULL && server->sbFill == 0 && !cork) {
+ if (server->ssl == NULL && server->sbFill == 0 && !cork && server->startTlsId == 0) {
// Nothing in send buffer, fire away
const int ret = write(server->fd, buffer, len);
if (ret == 0 || (ret < 0 && errno != EINTR && errno != EAGAIN)) {
@@ -832,11 +832,12 @@ static BOOL server_handleStartTlsResponse(epoll_server_t *server, const size_t m
return FALSE;
}
if (messageId != server->startTlsId) {
- printf("[Server] STARTTLS reply doesn't have expected message id\n");
+ printf("[Server] STARTTLS reply doesn't have expected message id (want %d is %d)\n",
+ (int)server->startTlsId, (int)messageId);
return FALSE;
}
if (op != ExtendedResponse) {
- printf("[Server] STARTTLS reply doesn't have op ExtendedResponse\n");
+ printf("[Server] STARTTLS reply doesn't have op ExtendedResponse but %d\n", (int)op);
return FALSE;
}
enum asn1_tagclass tc;
@@ -849,11 +850,11 @@ static BOOL server_handleStartTlsResponse(epoll_server_t *server, const size_t m
return FALSE;
}
if (tag != ENUMERATED && tag != INTEGER) {
- printf("[Server] STARTTLS reply doesn't contain resultCode\n");
+ printf("[Server] STARTTLS reply doesn't contain resultCode (INT/ENUM) but tag %d\n", (int)tag);
return FALSE;
}
if (value != 0) {
- printf("[Server] STARTTLS reply has resultCode != 0\n");
+ printf("[Server] STARTTLS reply has resultCode == %d\n", (int)value);
return FALSE;
}
if (!server_connectSsl(server)) {