@@ -1295,14 +1295,19 @@ void respond_request(http_request_t *req) {
12951295 record_stop ();
12961296 }
12971297 }
1298+ struct tm * start = localtime (& recordStartTime );
1299+ char start_time [64 ];
1300+ strftime (start_time , sizeof (start_time ), "%Y-%m-%dT%H:%M:%SZ" , start );
1301+
12981302 respLen = sprintf (response ,
12991303 "HTTP/1.1 200 OK\r\n"
13001304 "Content-Type: application/json;charset=UTF-8\r\n"
13011305 "Connection: close\r\n"
13021306 "\r\n"
1303- "{\"recording\":%s,\"path\":\"%s\",\"filename\":\"%s\",\"segment_size\":%d}" ,
1304- recordOn ? "true" : "false" , app_config .record_path ,
1305- app_config .record_filename , app_config .record_segment_size );
1307+ "{\"recording\":%s,\"start_time\":\"%s\",\"path\":\"%s\","
1308+ "\"filename\":\"%s\",\"segment_size\":%d}" ,
1309+ recordOn ? "true" : "false" , recordStartTime ,
1310+ app_config .record_path , app_config .record_filename , app_config .record_segment_size );
13061311 send_and_close (req -> clntFd , response , respLen );
13071312 return ;
13081313 }
@@ -1349,11 +1354,11 @@ void respond_request(http_request_t *req) {
13491354 short result = strtol (value , & remain , 10 );
13501355 if (remain == value ) continue ;
13511356 t .tv_sec = result ;
1352- clock_settime (0 , & t );
1357+ clock_settime (CLOCK_REALTIME , & t );
13531358 }
13541359 }
13551360 }
1356- clock_gettime (0 , & t );
1361+ clock_gettime (CLOCK_REALTIME , & t );
13571362 int respLen = sprintf (response ,
13581363 "HTTP/1.1 200 OK\r\n"
13591364 "Content-Type: application/json;charset=UTF-8\r\n"
0 commit comments