parse status header code from cgi scripts
[project/uhttpd.git] / proc.c
diff --git a/proc.c b/proc.c
index 9d662ad..4880727 100644 (file)
--- a/proc.c
+++ b/proc.c
@@ -169,7 +169,7 @@ static void proc_handle_header(struct relay *r, const char *name, const char *va
        char *sep;
        char buf[4];
 
-       if (strcmp(name, "Status")) {
+       if (!strcmp(name, "Status")) {
                sep = strchr(val, ' ');
                if (sep != val + 3)
                        return;
@@ -178,6 +178,7 @@ static void proc_handle_header(struct relay *r, const char *name, const char *va
                buf[3] = 0;
                snprintf(status_buf, sizeof(status_buf), "%s", sep + 1);
                cl->dispatch.proc.status_msg = status_buf;
+               cl->dispatch.proc.status_code = atoi(buf);
                return;
        }