patch-2.3.14 linux/net/khttpd/structure.h

Next file: linux/net/khttpd/sysctl.c
Previous file: linux/net/khttpd/sockets.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.13/linux/net/khttpd/structure.h linux/net/khttpd/structure.h
@@ -0,0 +1,84 @@
+#ifndef _INCLUDE_GUARD_STRUCTURE_H_
+#define _INCLUDE_GUARD_STRUCTURE_H_
+
+#include <linux/time.h>
+#include <linux/wait.h>
+
+
+struct http_request;
+
+struct http_request
+{
+	/* Linked list */
+	struct http_request *Next;
+	
+	/* Network and File data */
+	struct socket	*sock;		
+	struct file	*filp;		
+
+	/* Raw data about the file */
+	
+	int		FileLength;	/* File length in bytes */
+	int		Time;		/* mtime of the file, unix format */
+	int		BytesSent;	/* The number of bytes already sent */
+	int		IsForUserspace;	/* 1 means let Userspace handle this one */
+	
+	/* Wait queue */
+	
+	wait_queue_t sleep;		/* For putting in the socket's waitqueue */
+	
+	/* HTTP request information */
+	char		FileName[256];	/* The requested filename */
+	int		FileNameLength; /* The length of the string representing the filename */
+	char		Agent[128];	/* The agent-string of the remote browser */
+	char		IMS[128];	/* If-modified-since time, rfc string format */
+	char		Host[128];	/* Value given by the Host: header */
+	int		HTTPVER;        /* HTTP-version; 9 for 0.9,   10 for 1.0 and above */
+
+
+	/* Derived date from the above fields */	
+	int		IMS_Time;	/* if-modified-since time, unix format */
+	char		TimeS[64];	/* File mtime, rfc string representation */
+	char		LengthS[14];	/* File length, string representation */
+	char		*MimeType;	/* Pointer to a string with the mime-type 
+					   based on the filename */
+	int		MimeLength;	/* The length of this string */
+	
+};
+
+
+
+/*
+
+struct khttpd_threadinfo represents the four queues that 1 thread has to deal with.
+It is padded to occupy 1 (Intel) cache-line, to avoid "cacheline-pingpong".
+
+*/
+struct khttpd_threadinfo
+{
+	struct http_request* WaitForHeaderQueue;
+	struct http_request* DataSendingQueue;
+	struct http_request* LoggingQueue;
+	struct http_request* UserspaceQueue;
+	char  dummy[16];  /* Padding for cache-lines */
+};
+
+
+/*
+
+struct khttpd_delayed_release is used to build a list of all struct sockets
+that were passed to userspace. It seems to be required that they are not destroyed
+immediatly, so they have a timeout-counter.
+
+*/
+struct khttpd_delayed_release;
+
+struct khttpd_delayed_release
+{
+	struct socket *sock;
+	unsigned long timeout;
+	
+	struct khttpd_delayed_release *Next;
+};
+
+#endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)