#define AUTH_COOKIE 1
#define AUTH_BASIC 2
-typedef struct _ParsedHttpHdrs {
- int http_sock; /**< HTTP server socket */
- const char *Pos;
- StrBuf *ReadBuf;
+
+typedef struct _HdrRefs {
long eReqType; /**< eGET, ePOST.... */
- const WebcitHandler *Handler;
-
- int DontNeedAuth;
- int got_auth;
+ int desired_session;
int SessionKey;
+
+ int got_auth;
+ int DontNeedAuth;
long ContentLength;
time_t if_modified_since;
int gzip_ok; /**< Nonzero if Accept-encoding: gzip */
+ int prohibit_caching;
+ int dav_depth;
- StrBuf *c_username;
- StrBuf *c_password;
- StrBuf *c_roomname;
- StrBuf *RawCookie;
- int desired_session;
-
+ /* these are references into Hdr->HTTPHeaders, so we don't need to free them. */
StrBuf *ContentType;
-
- StrBuf *RawLine;/* TODO: freeme */
+ StrBuf *RawCookie;
StrBuf *ReqLine;
StrBuf *http_host; /**< HTTP Host: header */
StrBuf *browser_host;
StrBuf *user_agent;
StrBuf *plainauth;
+ StrBuf *dav_ifmatch;
+ const WebcitHandler *Handler;
+} HdrRefs;
+
+typedef struct _ParsedHttpHdrs {
+ int http_sock; /**< HTTP server socket */
+ const char *Pos;
+ StrBuf *ReadBuf;
+
+ StrBuf *c_username;
+ StrBuf *c_password;
+ StrBuf *c_roomname;
+ StrBuf *c_language;
StrBuf *this_page; /**< URL of current page */
- StrBuf *PlainArgs; /*TODO: freeme*/
+ StrBuf *PlainArgs;
+
HashList *urlstrings; /**< variables passed to webcit in a URL */
HashList *HTTPHeaders; /**< the headers the client sent us */
int nWildfireHeaders; /**< how many wildfire headers did we already send? */
+
+ HdrRefs HR;
} ParsedHttpHdrs;
void RegisterHeaderHandler(const char *Name, long Len, Header_Evaluator F);
-/* values for WC->current_iconbar */
-enum {
- current_iconbar_menu, /* view the icon menue */
- current_iconbar_roomlist /* view the roomtree */
-};
enum {
S_SELECT,
S_SHUTDOWN,
void begin_critical_section(int which_one);
void end_critical_section(int which_one);
-
-void stuff_to_cookie(char *cookie, size_t clen, int session,
- StrBuf *user, StrBuf *pass, StrBuf *room);
-void cookie_to_stuff(StrBuf *cookie, int *session,
- StrBuf *user,
- StrBuf *pass,
- StrBuf *room);
+void stuff_to_cookie(char *cookie, size_t clen,
+ int session,
+ StrBuf *user,
+ StrBuf *pass,
+ StrBuf *room,
+ char *language
+);
+void cookie_to_stuff(StrBuf *cookie,
+ int *session,
+ StrBuf *user,
+ StrBuf *pass,
+ StrBuf *room,
+ StrBuf *language
+);
void locate_host(StrBuf *TBuf, int);
void become_logged_in(const StrBuf *user, const StrBuf *pass, StrBuf *serv_response);
void openid_manual_create(void);
void text_to_server_qp(char *ptr);
void confirm_delete_msg(void);
void display_success(char *);
-void authorization_required(const char *message);
void CheckAuthBasic(ParsedHttpHdrs *hdr);
void GetAuthBasic(ParsedHttpHdrs *hdr);
-
-int ReEstablish_Session(void);
-
void server_to_text(void);
void save_edit(char *description, char *enter_cmd, int regoto);
void display_edit(char *description, char *check_cmd,
int is_mobile_ua(char *user_agent);
void embed_room_banner(char *, int);
-#define FLOOR_PARAM_LEN 3
-extern const char FLOOR_PARAM_NAMES[(FLOOR_PARAM_LEN + 1)][15];
-extern const int FLOOR_PARAM_NAMELEN[(FLOOR_PARAM_LEN + 1)];
-#define FPKEY(a) FLOOR_PARAM_NAMES[a], FLOOR_PARAM_NAMELEN[a]
-#define ROOM_PARAM_LEN 8
-extern const char ROOM_PARAM_NAMES[(ROOM_PARAM_LEN + 1)][20];
-extern const int ROOM_PARAM_NAMELEN[(ROOM_PARAM_LEN +1)];
-#define RPKEY(a) ROOM_PARAM_NAMES[a], ROOM_PARAM_NAMELEN[a]
HashList *GetFloorListHash(StrBuf *Target, WCTemplputParams *TP);
HashList *GetRoomListHash(StrBuf *Target, WCTemplputParams *TP);
int SortRoomsByListOrder(const void *room1, const void *room2);
#define WC_TIMEFORMAT_AMPM 1
#define WC_TIMEFORMAT_24 2
-
-void LoadIconSettings(void);