- rsp->body = fill_template(csp, template, exports);
- free_map(exports);
-
- if (!strcmp(template, "no-such-domain"))
- {
- rsp->status = strdup("404 No such domain");
- }
- else if (!strcmp(template, "connect-failed"))
- {
- rsp->status = strdup("503 Connect failed");
- }
+ rsp->body = fill_template(csp, templatename, exports);
+ free_map(exports);
+
+ if (!strcmp(templatename, "no-such-domain"))
+ {
+ rsp->status = strdup("404 No such domain");
+ }
+ else if (!strcmp(templatename, "connect-failed"))
+ {
+ rsp->status = strdup("503 Connect failed");
+ }
+
+ return(finish_http_response(rsp));
+}
+
+
+/*********************************************************************
+ *
+ * Function : get_http_time
+ *
+ * Description : Get the time in a format suitable for use in a
+ * HTTP header - e.g.:
+ * "Sun, 06 Nov 1994 08:49:37 GMT"
+ *
+ * Parameters :
+ * 1 : time_offset = Time returned will be current time
+ * plus this number of seconds.
+ * 2 : buf = Destination for result. Must be long enough
+ * to hold 29 characters plus a trailing zero.
+ *
+ * Returns : N/A
+ *
+ *********************************************************************/
+static void get_http_time(int time_offset, char * buf)
+{
+ static const char day_names[7][4] =
+ { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+ static const char month_names[12][4] =
+ { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };