$Log$
+Revision 400.27 2002/09/27 17:15:44 ajc
+* Removed the gzip compression stuff due to bugs in Internet Explorer.
+
Revision 400.26 2002/09/27 04:37:21 ajc
* New, buggy versions of event editing screens
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
AC_CANONICAL_HOST
-AC_ARG_WITH(with_zlib, [ --with-zlib use zlib compression if present])
AC_ARG_WITH(with_libical, [ --with-libical use libical calendaring library])
dnl Set some system-specific variables which are OK to set before compiler
dnl AC_CHECK_FUNCS(strerror)
AC_REPLACE_FUNCS(snprintf)
-dnl Checks for the zlib compression library.
-if test "x$with_zlib" != xno ; then
- AC_CHECK_HEADERS(zlib.h,
- [AC_CHECK_LIB(z, zlibVersion,
- [ok_zlib=yes],,
- )])
-fi
-
-if test "x$ok_zlib" != xno ; then
- LIBS="-lz $LIBS"
- AC_DEFINE(HAVE_ZLIB)
-fi
-
dnl Checks for the libical calendaring library.
if test "x$with_libical" != xno ; then
AC_CHECK_HEADERS(ical.h,
int desired_session = 0;
int got_cookie = 0;
struct wcsession *TheSession, *sptr;
- int gzip = 0;
-
-#ifdef HAVE_ZLIB_H
- int i;
- char enc[SIZ];
- char encodings[SIZ];
-#endif
/*
* Find out what it is that the web browser is asking for
got_cookie = 1;
}
-#ifdef HAVE_ZLIB_H
- if (!strncasecmp(buf, "Accept-encoding: ", 17)) {
- extract_token(encodings, &buf[17], 0, ';');
- for (i=0; i<num_tokens(encodings, ','); ++i) {
- extract_token(enc, encodings, i, ',');
- if (!strcasecmp(enc, "gzip")) {
- gzip = 1;
- }
- }
- }
-#endif
-
hptr = (struct httprequest *)
malloc(sizeof(struct httprequest));
if (req == NULL)
pthread_setspecific(MyConKey, (void *)TheSession);
TheSession->http_sock = sock;
TheSession->lastreq = time(NULL); /* log */
- session_loop(req, gzip); /* perform the requested transaction */
+ session_loop(req); /* perform the requested transaction */
pthread_mutex_unlock(&TheSession->SessionMutex); /* unbind */
/* Free the request buffer */
output_headers(3);
if (prepend_html != NULL) {
- http_write(WC->http_sock, prepend_html, strlen(prepend_html));
+ write(WC->http_sock, prepend_html, strlen(prepend_html));
}
serv_printf("LFLR"); /* FIXME put a real test here */
}
/* Output our big pile of markup */
- http_write(WC->http_sock, converted_msg, output_length);
+ write(WC->http_sock, converted_msg, output_length);
/* A little trailing vertical whitespace... */
wprintf("<BR><BR>\n");
}
-#ifdef HAVE_ZLIB_H
-
-ssize_t http_write(int fd, void *buf, size_t count) {
-
- if (WC->gzfd) {
- return gzwrite(WC->gzfd, buf, count);
- }
- else {
- return write(fd, buf, count);
- }
-
-
-}
-
-#else
-
-ssize_t http_write(int fd, void *buf, size_t count) {
- return write(fd, buf, count);
-}
-
-#endif
-
-
-
-
void wprintf(const char *format,...)
{
va_list arg_ptr;
vsprintf(wbuf, format, arg_ptr);
va_end(arg_ptr);
- http_write(WC->http_sock, wbuf, strlen(wbuf));
+ write(WC->http_sock, wbuf, strlen(wbuf));
}
int suppress_check = 0;
char httpnow[SIZ];
static int pageseq = 0;
-#ifdef HAVE_ZLIB_H
- gzFile temp_gzfd = NULL;
-#endif
-
print_standard_html_head = controlcode & 0x03;
refresh30 = ((controlcode & 0x04) >> 2);
suppress_check = ((controlcode & 0x08) >> 3);
httpdate(httpnow, time(NULL));
-#ifdef HAVE_ZLIB_H
- if (WC->gzcompressed) {
- temp_gzfd = gzdopen(WC->http_sock, "wb9");
- }
-#endif
-
if (print_standard_html_head > 0) {
wprintf("Content-type: text/html\n"
"Server: %s\n", SERVER
"Pragma: no-cache\n"
"Cache-Control: no-store\n"
);
-#ifdef HAVE_ZLIB_H
- if (temp_gzfd != NULL) {
- wprintf("Content-Encoding: gzip\n");
- }
-#endif
}
stuff_to_cookie(cookie, WC->wc_session, WC->wc_username,
WC->wc_password, WC->wc_roomname);
if (print_standard_html_head > 0) {
wprintf("\n");
-#ifdef HAVE_ZLIB_H
- if (temp_gzfd != NULL) {
- WC->gzfd = temp_gzfd;
- }
-#endif
-
wprintf("<HTML><HEAD><TITLE>");
escputs(serv_info.serv_humannode);
wprintf("</TITLE>\n"
(long) length,
SERVER
);
- http_write(WC->http_sock, thing, (size_t)length);
+ write(WC->http_sock, thing, (size_t)length);
}
else {
memset(xferbuf, 0, thisblock);
}
- http_write(WC->http_sock, xferbuf, thisblock);
+ write(WC->http_sock, xferbuf, thisblock);
bytes = bytes - thisblock;
accomplished = accomplished + thisblock;
}
/*
* Entry point for WebCit transaction
*/
-void session_loop(struct httprequest *req, int gzip)
+void session_loop(struct httprequest *req)
{
char cmd[SIZ];
char action[SIZ];
WC->is_wap = 0;
-#ifdef HAVE_ZLIB_H
- if (gzip) {
- WC->gzcompressed = 1;
- }
- else {
- WC->gzcompressed = 0;
- }
-#endif
-
hptr = req;
if (hptr == NULL) return;
WC->upload_length = 0;
}
-#ifdef HAVE_ZLIB_H
- if (WC->gzfd) {
- gzclose(WC->gzfd);
- WC->gzfd = NULL;
- WC->gzcompressed = 0;
- }
-#endif
}
char this_page[SIZ]; /* address of current page */
char http_host[SIZ]; /* HTTP Host: header */
char *preferences;
-#ifdef HAVE_ZLIB_H
- int gzcompressed; /* nonzero if compressed output */
- gzFile gzfd; /* stream to send compressed */
-#endif
#ifdef HAVE_ICAL_H
icalcomponent **disp_cal; /* store calendar items for display */
long *cal_msgnum; /* store calendar msgids for display */
void embed_room_banner(char *);
void smart_goto(char *);
void worker_entry(void);
-void session_loop(struct httprequest *, int gzip);
+void session_loop(struct httprequest *);
void fmt_date(char *buf, time_t thetime);
void httpdate(char *buf, time_t thetime);
void end_webcit_session(void);
void display_calendar(long msgnum);
void display_task(long msgnum);
void do_calendar_view(void);
-ssize_t http_write(int fd, void *buf, size_t count);
#ifdef HAVE_ICAL_H
void display_edit_task(void);