From 5ffad8984ab0276ece6080d5949196136f3c93f8 Mon Sep 17 00:00:00 2001 From: FRIGN Date: Thu, 7 Aug 2014 16:34:46 +0200 Subject: [PATCH] Use named indices for the response-entry-array It was actually sitting right in front of my eyes in the sighandler-funtion. This will help sort out ambiguities or mixing up array-indices. --- quark.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/quark.c b/quark.c index 0a39e91..25b65f8 100644 --- a/quark.c +++ b/quark.c @@ -55,11 +55,12 @@ enum { }; static const char *resentry[] = { - "HTTP/1.1 %s\r\nConnection: close\r\nDate: %s\r\nServer: quark-"VERSION"\r\n", - "Content-Length: %lu\r\n", - "Location: %s%s\r\n", - "Content-Type: %s\r\n", - "Last-Modified: %s\r\n" }; + [HEADER] = "HTTP/1.1 %s\r\nConnection: close\r\nDate: %s\r\nServer: quark-"VERSION"\r\n", + [CONTENTLEN] = "Content-Length: %lu\r\n", + [LOCATION] = "Location: %s%s\r\n", + [CONTENTTYPE] = "Content-Type: %s\r\n", + [MODIFIED] = "Last-Modified: %s\r\n" +}; static ssize_t writetext(const char *buf); static ssize_t writedata(const char *buf, size_t buflen);