diff --git a/include/httpd.h b/include/httpd.h new file mode 100644 index 000000000..6e6eefb03 --- /dev/null +++ b/include/httpd.h @@ -0,0 +1,52 @@ +/* + * This file is distributed as part of the SkySQL Gateway. It is free + * software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, + * version 2. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License along with + * this program; if not, write to the Free Software Foundation, Inc., 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Copyright SkySQL Ab 2013 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define HTTPD_USER_MAXLEN 128 +#define HTTPD_HOSTNAME_MAXLEN 512 +#define HTTPD_USERAGENT_MAXLEN 1024 +#define HTTPD_FIELD_MAXLEN 8192 +#define HTTPD_REQUESTLINE_MAXLEN 8192 + +/** + * HTTPD session specific data + * + */ +typedef struct httpd_session { + char user[HTTPD_USER_MAXLEN]; /**< username for authentication*/ + char *cookies; /**< all input cookies */ + char hostname[HTTPD_HOSTNAME_MAXLEN]; /**< The hostname */ + char useragent[HTTPD_USERAGENT_MAXLEN]; /**< The useragent */ + int headers_received; /**< All the headers has been received, if 1 */ +} HTTPD_session;