Overview
Comment: | Fixed segfault issue and updated to limit sendfile() size |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
47ef170824ca0327a37651aee6921010 |
User & Date: | rkeene on 2014-02-06 08:03:00 |
Other Links: | manifest | tags |
Context
2014-02-06
| ||
08:26 | Added additional debugging regarding range computation check-in: c35e6a2d15 user: rkeene tags: trunk | |
08:03 | Fixed segfault issue and updated to limit sendfile() size check-in: 47ef170824 user: rkeene tags: trunk | |
07:53 | Added large file support check-in: abb8c966f2 user: rkeene tags: trunk | |
Changes
Modified filed.c from [5dd5b62c7d] to [107a3dbac4].
︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | + + + | #include <unistd.h> #include <string.h> #include <fcntl.h> #include <stdio.h> #include <errno.h> #include <time.h> /* Compile time constants */ #define FILED_SENDFILE_MAX 16777215 /* Default values */ #define MAX_FAILURE_COUNT 30 #define PORT 8080 #define THREAD_COUNT 10 #define BIND_ADDR "::" #define CACHE_SIZE 8192 |
︙ | |||
378 379 380 381 382 383 384 | 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | - + - - - + + + | ); } /* Handle a single request from a client */ static void filed_handle_client(int fd, struct filed_http_request *request) { struct filed_fileinfo *fileinfo; ssize_t sendfile_ret; |
︙ | |||
485 486 487 488 489 490 491 | 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 | + + + + + + - + | filed_log_msg("SEND_START IFD=... OFD=... BYTES=..."); sendfile_offset = request->headers.range.offset; sendfile_len = request->headers.range.length; sendfile_sent = 0; while (1) { if (sendfile_len > FILED_SENDFILE_MAX) { sendfile_size = FILED_SENDFILE_MAX; } else { sendfile_size = sendfile_len; } |
︙ |