-const char cgi_rcs[] = "$Id: cgi.c,v 1.20 2001/09/13 23:40:36 jongfoster Exp $";
+const char cgi_rcs[] = "$Id: cgi.c,v 1.21 2001/09/13 23:53:03 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.c,v $
*
* Revisions :
* $Log: cgi.c,v $
+ * Revision 1.21 2001/09/13 23:53:03 jongfoster
+ * Support for both static and dynamically generated CGI pages.
+ * Correctly setting Last-Modified: and Expires: HTTP headers.
+ *
* Revision 1.20 2001/09/13 23:40:36 jongfoster
* (Cosmetic only) Indentation correction
*
*/
/* Get mem for response or fail*/
- if (NULL == ( rsp = zalloc(sizeof(*rsp))))
+ if (NULL == (rsp = alloc_http_response()))
{
return NULL;
}
struct http_response *rsp;
struct map * exports = default_exports(csp, NULL);
- if (NULL == ( rsp = (struct http_response *)zalloc(sizeof(*rsp))))
+ if (NULL == (rsp = alloc_http_response()))
{
return NULL;
}
}
+/*********************************************************************
+ *
+ * Function : alloc_http_response
+ *
+ * Description : Allocates a new http_response structure.
+ *
+ * Parameters : N/A
+ *
+ * Returns : pointer to a new http_response, or NULL.
+ *
+ *********************************************************************/
+struct http_response * alloc_http_response(void)
+{
+ return (struct http_response *) zalloc(sizeof(struct http_response));
+}
+
+
/*********************************************************************
*
* Function : free_http_response
#ifndef CGI_H_INCLUDED
#define CGI_H_INCLUDED
-#define CGI_H_VERSION "$Id: cgi.h,v 1.11 2001/08/05 16:06:20 jongfoster Exp $"
+#define CGI_H_VERSION "$Id: cgi.h,v 1.12 2001/09/13 23:31:25 jongfoster Exp $"
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/cgi.h,v $
*
* Revisions :
* $Log: cgi.h,v $
+ * Revision 1.12 2001/09/13 23:31:25 jongfoster
+ * Moving image data to cgi.c rather than cgi.h.
+ *
* Revision 1.11 2001/08/05 16:06:20 jongfoster
* Modifiying "struct map" so that there are now separate header and
* "map_entry" structures. This means that functions which modify a
/*
* CGI support functions
*/
-extern struct http_response *finish_http_response(struct http_response *rsp);
+extern struct http_response * alloc_http_response(void);
extern void free_http_response(struct http_response *rsp);
+extern struct http_response *finish_http_response(struct http_response *rsp);
+
extern struct map * default_exports(const struct client_state *csp, const char *caller);
extern void map_block_killer(struct map *map, const char *name);
extern void map_conditional(struct map *exports, const char *name, int choose_first);
-const char filters_rcs[] = "$Id: filters.c,v 1.28 2001/09/10 10:18:51 oes Exp $";
+const char filters_rcs[] = "$Id: filters.c,v 1.29 2001/09/13 23:32:40 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/filters.c,v $
*
* Revisions :
* $Log: filters.c,v $
+ * Revision 1.29 2001/09/13 23:32:40 jongfoster
+ * Moving image data to cgi.c rather than cgi.h
+ * Fixing a GPF under Win32 (and any other OS that protects global
+ * constants from being written to).
+ *
* Revision 1.28 2001/09/10 10:18:51 oes
* Silenced compiler warnings
*
/*
* Else, prepare a response
*/
- if (NULL == ( rsp = (struct http_response *)zalloc(sizeof(*rsp))))
+ if (NULL == (rsp = alloc_http_response()))
{
return NULL;
}
/*
* Else, prepare a response:
*/
- if (NULL == ( rsp = (struct http_response *)zalloc(sizeof(*rsp))))
+ if (NULL == (rsp = alloc_http_response()))
{
return NULL;
}
{
log_error(LOG_LEVEL_REDIRECTS, "redirecting to: %s", q);
- if (NULL == ( rsp = zalloc(sizeof(*rsp))))
+ if (NULL == (rsp = alloc_http_response()))
{
return NULL;
}