Beautify diagnostic messages.
[linux-2.6/linux-mips.git] / net / khttpd / logging.c
blob229116788776f2dd2c94214036f9186648d57553
1 /*
3 kHTTPd -- the next generation
5 logging.c takes care of shutting down a connection.
7 */
8 /****************************************************************
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 ****************************************************************/
25 #include <linux/kernel.h>
26 #include <linux/skbuff.h>
27 #include <linux/smp_lock.h>
28 #include <net/tcp.h>
29 #include <asm/uaccess.h>
30 #include "structure.h"
31 #include "prototypes.h"
35 Purpose:
37 Logging() terminates "finished" connections and will eventually log them to a
38 userspace daemon.
40 Return value:
41 The number of requests that changed status, thus the number of connections
42 that shut down.
46 int Logging(const int CPUNR)
48 struct http_request *CurrentRequest,*Req;
49 int count = 0;
51 EnterFunction("Logging");
53 CurrentRequest = threadinfo[CPUNR].LoggingQueue;
55 /* For now, all requests are removed immediatly, but this changes
56 when userspace-logging is added. */
58 while (CurrentRequest!=NULL)
61 Req = CurrentRequest->Next;
63 CleanUpRequest(CurrentRequest);
65 threadinfo[CPUNR].LoggingQueue = Req;
67 CurrentRequest = Req;
69 count++;
73 LeaveFunction("Logging");
74 return count;
79 void StopLogging(const int CPUNR)
81 struct http_request *CurrentRequest,*Next;
83 EnterFunction("StopLogging");
84 CurrentRequest = threadinfo[CPUNR].LoggingQueue;
86 while (CurrentRequest!=NULL)
88 Next=CurrentRequest->Next;
89 CleanUpRequest(CurrentRequest);
90 CurrentRequest=Next;
93 threadinfo[CPUNR].LoggingQueue = NULL;
94 LeaveFunction("StopLogging");