Re-send with attachment.

- Lauri
>From 166bed5638b18ff6472fc2ab4ddd97d2cd8181be Mon Sep 17 00:00:00 2001
From: Lauri Kasanen <[email protected]>
Date: Thu, 14 Jun 2012 11:53:09 +0300
Subject: [PATCH 3/3] cgi: Use worker_spawn_arg to save thread resources 
(DETACHED)


Signed-off-by: Lauri Kasanen <[email protected]>
---
 plugins/cgi/cgi.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/plugins/cgi/cgi.c b/plugins/cgi/cgi.c
index ce32690..07b0b3a 100644
--- a/plugins/cgi/cgi.c
+++ b/plugins/cgi/cgi.c
@@ -63,14 +63,12 @@ static int swrite(const int fd, const void *buf, const 
size_t count)
     return 1;
 }
 
-static void *cgi_write_post(void *p)
+static void cgi_write_post(void *p)
 {
     const struct post_t * const in = p;
 
     swrite(in->fd, in->buf, in->len);
     close(in->fd);
-
-    return NULL;
 }
 
 static int do_cgi(const char * const __restrict__ file, const char * const 
__restrict__ url,
@@ -228,9 +226,7 @@ static int do_cgi(const char * const __restrict__ file, 
const char * const __res
         p.buf = sr->data.data;
         p.len = sr->data.len;
 
-        pthread_t tid;
-
-        pthread_create(&tid, NULL, cgi_write_post, &p);
+        mk_api->worker_spawn_arg(cgi_write_post, &p);
     }
 
     char buf[PATHLEN], *outptr;
-- 
1.7.2.1

_______________________________________________
Monkey mailing list
[email protected]
http://lists.monkey-project.com/listinfo/monkey

Reply via email to