2 * uhttpd - Tiny single-threaded httpd - Main header
4 * Copyright (C) 2010 Jo-Philipp Wich <xm@subsignal.org>
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
26 #include <sys/types.h>
27 #include <sys/socket.h>
28 #include <sys/select.h>
30 #include <netinet/in.h>
31 #include <netinet/tcp.h>
32 #include <arpa/inet.h>
33 #include <linux/limits.h>
45 #include <openssl/ssl.h>
54 #define UH_LIMIT_MSGHEAD 4096
55 #define UH_LIMIT_HEADERS 64
57 #define UH_LIMIT_CLIENTS 64
59 #define UH_HTTP_MSG_GET 0
60 #define UH_HTTP_MSG_HEAD 1
61 #define UH_HTTP_MSG_POST 2
69 char docroot
[PATH_MAX
];
85 lua_State
* (*lua_init
) (const char *handler
);
86 void (*lua_close
) (lua_State
*L
);
87 void (*lua_request
) (struct client
*cl
, struct http_request
*req
, lua_State
*L
);
89 #if defined(HAVE_CGI) || defined(HAVE_LUA)
96 SSL_CTX
* (*tls_init
) (void);
97 int (*tls_cert
) (SSL_CTX
*c
, const char *file
);
98 int (*tls_key
) (SSL_CTX
*c
, const char *file
);
99 void (*tls_free
) (struct listener
*l
);
100 void (*tls_accept
) (struct client
*c
);
101 void (*tls_close
) (struct client
*c
);
102 int (*tls_recv
) (struct client
*c
, void *buf
, int len
);
103 int (*tls_send
) (struct client
*c
, void *buf
, int len
);
109 struct sockaddr_in6 addr
;
114 struct listener
*next
;
120 char peekbuf
[UH_LIMIT_MSGHEAD
];
121 struct listener
*server
;
122 struct sockaddr_in6 servaddr
;
123 struct sockaddr_in6 peeraddr
;
134 struct auth_realm
*next
;
137 struct http_request
{
142 char *headers
[UH_LIMIT_HEADERS
];
143 struct auth_realm
*realm
;
146 struct http_response
{
149 char *headers
[UH_LIMIT_HEADERS
];
156 struct interpreter
*next
;
This page took 0.049935 seconds and 5 git commands to generate.