[hackers] [quark] Use named indices for the response-entry-array || FRIGN

From: <git_AT_suckless.org>
Date: Thu, 07 Aug 2014 16:34:23 +0200

commit 5ffad8984ab0276ece6080d5949196136f3c93f8
Author: FRIGN <dev_AT_frign.de>
Date: Thu Aug 7 16:34:46 2014 +0200

    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.

diff --git a/quark.c b/quark.c
index 0a39e91..25b65f8 100644
--- a/quark.c
+++ b/quark.c
_AT_@ -55,11 +55,12 @@ enum {
 };
 
 static const char *resentry[] = {
- "HTTP/1.1 %s
Connection: close
Date: %s
Server: quark-"VERSION"
",
- "Content-Length: %lu
",
- "Location: %s%s
",
- "Content-Type: %s
",
- "Last-Modified: %s
" };
+ [HEADER] = "HTTP/1.1 %s
Connection: close
Date: %s
Server: quark-"VERSION"
",
+ [CONTENTLEN] = "Content-Length: %lu
",
+ [LOCATION] = "Location: %s%s
",
+ [CONTENTTYPE] = "Content-Type: %s
",
+ [MODIFIED] = "Last-Modified: %s
"
+};
 
 static ssize_t writetext(const char *buf);
 static ssize_t writedata(const char *buf, size_t buflen);
Received on Thu Aug 07 2014 - 16:34:23 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 07 2014 - 16:36:14 CEST