summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2004-07-22 03:46:14 +0000
committerStef Walter <stef@memberwebs.com>2004-07-22 03:46:14 +0000
commit3877595290696d958e2e3a5b4e8c2dbc8ada589b (patch)
tree584186a428fc56576b8a0e85aaaa2f24cf1d5f3f
parent4e2e17233ed410862852e78fd1c022d0a4b1ffa3 (diff)
- Unique id should be in lock
-rw-r--r--ChangeLog2
-rw-r--r--common/smtppass.c7
-rw-r--r--src/clamsmtpd.c7
3 files changed, 9 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 4c613da..4052241 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
0.4
- Option for quarantining files with viruses
- Fixed problem with returning wrong SMTP error code
- - Fixed handling of timeouts
+ - Handling timeouts properly
- Fixed stupid problem with sockets not getting closed properly
0.3
diff --git a/common/smtppass.c b/common/smtppass.c
index 7f7d8e6..f021a8b 100644
--- a/common/smtppass.c
+++ b/common/smtppass.c
@@ -551,13 +551,14 @@ static void* thread_main(void* arg)
memset(&ctx, 0, sizeof(ctx));
- /* Assign a unique id to the connection */
- ctx.id = g_unique_id++;
-
ctx.server = -1;
ctx.clam = -1;
plock();
+ /* Assign a unique id to the connection */
+ ctx.id = g_unique_id++;
+
+ /* Get the client socket */
ctx.client = thread->fd;
punlock();
diff --git a/src/clamsmtpd.c b/src/clamsmtpd.c
index 7f7d8e6..f021a8b 100644
--- a/src/clamsmtpd.c
+++ b/src/clamsmtpd.c
@@ -551,13 +551,14 @@ static void* thread_main(void* arg)
memset(&ctx, 0, sizeof(ctx));
- /* Assign a unique id to the connection */
- ctx.id = g_unique_id++;
-
ctx.server = -1;
ctx.clam = -1;
plock();
+ /* Assign a unique id to the connection */
+ ctx.id = g_unique_id++;
+
+ /* Get the client socket */
ctx.client = thread->fd;
punlock();