Overview
Comment: | Added support for a "no logging" compile-time option (for now) and updated to support sendfile restarts |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c7e703e4e5c6dcb188f7b97b9b722030 |
User & Date: | rkeene on 2014-02-05 09:01:12 |
Other Links: | manifest | tags |
Context
2014-02-05
| ||
09:04 | Additional improvements check-in: a00671c11b user: rkeene tags: trunk | |
09:01 | Added support for a "no logging" compile-time option (for now) and updated to support sendfile restarts check-in: c7e703e4e5 user: rkeene tags: trunk | |
08:49 | Updated to cache file descriptors check-in: 565d4b51c2 user: rkeene tags: trunk | |
Changes
Modified filed.c from [af10919239] to [f27d202156].
︙ | |||
10 11 12 13 14 15 16 | 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | - + | #include <string.h> #include <fcntl.h> #include <stdio.h> #include <time.h> /* Default values */ #define MAX_FAILURE_COUNT 30 |
︙ | |||
98 99 100 101 102 103 104 105 106 107 108 109 110 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | + + + + + + + - + | return(-1); } return(fd); } /* Log a message */ #define FILED_DONT_LOG #ifdef FILED_DONT_LOG # define filed_logging_thread_init() 0 # define filed_log_msg_debug(x, ...) /**/ # define filed_log_msg(x) /**/ #else /* Initialize logging thread */ static int filed_logging_thread_init(void) { /* XXX:TODO: Unimplemented */ return(0); } |
︙ | |||
292 293 294 295 296 297 298 299 300 301 302 303 304 305 | 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 | + | ); } /* Handle a single request from a client */ static void filed_handle_client(int fd) { struct filed_fileinfo *fileinfo, fileinfo_b; ssize_t sendfile_ret; size_t sendfile_len; off_t sendfile_offset; char *path, path_b[1010]; char *date_current, date_current_b[64]; FILE *fp; /* Determine current time */ date_current = filed_format_time(date_current_b, sizeof(date_current_b), time(NULL)); |
︙ | |||
341 342 343 344 345 346 347 | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 | + + - - + + - - - - + + + + + + + + + + | fflush(fp); filed_log_msg("PROCESS_REPLY_COMPLETE FD=... STATUS=200"); filed_log_msg("SEND_START IFD=... OFD=... BYTES=..."); sendfile_offset = 0; sendfile_len = fileinfo->len; while (1) { |
︙ | |||
462 463 464 465 466 467 468 | 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | - - + + + + + + - - + + + + + + | if (init_ret != 0) { perror("filed_init"); return(3); } /* Create logging thread */ |