kv.key = strdup(tok);
kv.val = strdup(eq);
array_append(h.request_parms, &kv);
+#ifdef DEBUG_HTTP
syslog(LOG_DEBUG, "\033[1m\033[33m| %s = %s\033[0m", kv.key, kv.val);
+#endif
}
}
}
syslog(LOG_DEBUG, "Client disconnected");
}
else {
+#ifdef DEBUG_HTTP
syslog(LOG_DEBUG, "\033[33m\033[1m< %s %s\033[0m", h.method, h.url);
+#endif
// If there is a request body, read it now.
char *ccl = header_val(&h, "Content-Length");
#endif
// Output the results back to the client.
+#ifdef DEBUG_HTTP
syslog(LOG_DEBUG, "\033[33m\033[1m> %03d %s\033[0m", h.response_code, h.response_string);
+#endif
client_printf(ch, "HTTP/1.1 %03d %s\r\n", h.response_code, h.response_string);
client_printf(ch, "Connection: close\r\n");
client_printf(ch, "Content-Length: %ld\r\n", h.response_body_length);