Changeset 142
- Timestamp:
- 02/16/06 15:30:32 (3 years ago)
- Files:
-
- fastphoto/trunk/src/Makefile.am (modified) (1 diff)
- fastphoto/trunk/src/header.c (modified) (1 diff)
- fastphoto/trunk/src/httpdate.c (added)
- fastphoto/trunk/src/httpdate.h (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
fastphoto/trunk/src/Makefile.am
r135 r142 5 5 bin_PROGRAMS = fastphoto 6 6 7 noinst_HEADERS = alloc_snprintf.h cache.h cgi.h header.h photo.h resize.h7 noinst_HEADERS = alloc_snprintf.h cache.h cgi.h header.h httpdate.h photo.h resize.h 8 8 9 fastphoto_SOURCES = main.c alloc_snprintf.c cache.c cgi.c header.c photo.c resize.c9 fastphoto_SOURCES = main.c alloc_snprintf.c cache.c cgi.c header.c httpdate.c photo.c resize.c 10 10 fastphoto_LDADD = $(EPEG_LIBS) fastphoto/trunk/src/header.c
r140 r142 4 4 #include <stdlib.h> 5 5 #include <string.h> 6 #include <time.h> 6 7 #include "httpdate.h" 7 8 8 9 #define CONTENT_TYPE_JPEG "Content-Type: image/jpeg\n" 9 10 static char * wdays[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};11 static char * months[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",12 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};13 14 static int15 http_date_snprint (char * buf, int n, time_t mtime)16 {17 struct tm * g;18 19 g = gmtime (&mtime);20 21 return snprintf (buf, n, "%s, %02d %s %4d %2d:%02d:%02d GMT",22 wdays[g->tm_wday], g->tm_mday, months[g->tm_mon],23 g->tm_year + 1900, g->tm_hour, g->tm_min, g->tm_sec);24 }25 10 26 11 int
