Add time to log prefix
This commit is contained in:
@ -17,6 +17,8 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
// TODO use pipes for stdin, stdout, stderr in FastCGI
|
||||
|
||||
char *fastcgi_add_param(char *buf, const char *key, const char *value) {
|
||||
char *ptr = buf;
|
||||
unsigned long key_len = strlen(key);
|
||||
|
@ -408,9 +408,9 @@ const char *http_get_status_color(status_code_t status_code) {
|
||||
}
|
||||
}
|
||||
|
||||
char *http_format_date(time_t time, char *buf, size_t size) {
|
||||
char *http_format_date(time_t ts, char *buf, size_t size) {
|
||||
struct tm time_info;
|
||||
strftime(buf, size, "%a, %d %b %Y %H:%M:%S GMT", gmtime_r(&time, &time_info));
|
||||
strftime(buf, size, "%a, %d %b %Y %H:%M:%S GMT", gmtime_r(&ts, &time_info));
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ long sock_send(sock *s, void *buf, unsigned long len, int flags) {
|
||||
long sock_send_x(sock *s, void *buf, unsigned long len, int flags) {
|
||||
long sent = 0;
|
||||
for (long ret; sent < len; sent += ret) {
|
||||
ret = sock_send(s, buf + sent, len - sent, flags);
|
||||
ret = sock_send(s, (unsigned char *) buf + sent, len - sent, flags);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user