Overview
Comment: | Added support for a --version option |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
aed08169142eba2c47ce207019497151 |
User & Date: | rkeene on 2014-02-08 06:08:09 |
Other Links: | manifest | tags |
Context
2014-02-08
| ||
06:08 | Syncronized version numbers check-in: dbd2e7012f user: rkeene tags: trunk | |
06:08 | Added support for a --version option check-in: aed0816914 user: rkeene tags: trunk | |
06:01 | Updated to become a daemon earlier so that opening "/dev/null" works check-in: 5d36185bbb user: rkeene tags: trunk | |
Changes
Modified filed.1 from [368e134ee9] to [fadd56c71b].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | + | .PU .TH FILED 1 "06 Feb 14" "filed 1.0" .SH NAME filed \- serve files over HTTP .SH SYNOPSIS .ll +10 .B filed .RB [{ \-h | \-\-help }] .RB [{ \-d | \-\-daemon }] .RB [{ \-v | \-\-version }] .RB [{ \-b | \-\-bind } .IR address ] .RB [{ \-p | \-\-port } .IR port ] .RB [{ \-t | \-\-threads } .IR count ] .RB [{ \-c | \-\-cache } |
︙ | |||
35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | + + + + + + | .TP .B -d (or --daemon) Instructs .B filed to become a daemon after initializing the listening TCP socket and log files. .TP .B -v (or --version) Instructs .B filed to print out its version number and then exit. .TP .B -b (or --bind) Specifies the address to listen for incoming HTTP requests on. .TP .B -p (or --port) |
︙ |
Modified filed.c from [c245fb8d4f] to [a6b140c86c].
︙ | |||
16 17 18 19 20 21 22 23 | 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | + - + | #include <fcntl.h> #include <stdio.h> #include <errno.h> #include <time.h> #include <pwd.h> /* Compile time constants */ #define FILED_VERSION "0.9" #define FILED_SENDFILE_MAX 16777215 |
︙ | |||
782 783 784 785 786 787 788 | 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 | - + | /* Handle incoming connections */ static void *filed_worker_thread(void *arg_v) { struct filed_worker_thread_args *arg; struct filed_http_request request; struct sockaddr_in6 addr; char logbuf_ip[128]; socklen_t addrlen; |
︙ | |||
869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 | 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 | + + + | fprintf(output, "%s\n", extra); } fprintf(output, "Usage: filed [<options>]\n"); fprintf(output, " Options:\n"); fprintf(output, " -h, --help\n"); fprintf(output, " -d, --daemon\n"); fprintf(output, " -v, --version\n"); fprintf(output, " -b <address>, --bind <address>\n"); fprintf(output, " -p <port>, --port <port>\n"); fprintf(output, " -t <count>, --threads <count>\n"); fprintf(output, " -c <entries>, --cache <entries>\n"); fprintf(output, " -l <file>, --log <file>\n"); fprintf(output, " -u <user>, --user <user>\n"); fprintf(output, " -r <directory>, --root <directory>\n"); if (long_help) { fprintf(output, "\n"); fprintf(output, " Usage:\n"); fprintf(output, " -h (or --help) prints this usage information.\n"); fprintf(output, "\n"); fprintf(output, " -d (or --daemon) instructs filed to become a daemon after initializing\n"); fprintf(output, " the listening TCP socket and log files.\n"); fprintf(output, "\n"); fprintf(output, " -v (or --version) instructs filed print out the version number and exit.\n"); fprintf(output, "\n"); fprintf(output, " -b (or --bind) specifies the address to listen for incoming HTTP\n"); fprintf(output, " requests on. The default value is \"%s\".\n", BIND_ADDR); fprintf(output, "\n"); fprintf(output, " -p (or --port) specifies the TCP port number to listen for incoming HTTP\n"); fprintf(output, " requests on. The default is %u.\n", (unsigned int) PORT); fprintf(output, "\n"); |
︙ | |||
1029 1030 1031 1032 1033 1034 1035 | 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 | - + - - + + + | close(fd_out); return(0); } /* Run process */ int main(int argc, char **argv) { |
︙ | |||
1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 | 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 | + + + + | break; case 'l': log_file = strdup(optarg); break; case 'd': daemon_enabled = 1; break; case 'v': printf("filed version %s\n", FILED_VERSION); return(0); case '?': case ':': filed_print_help(stderr, 0, NULL); return(1); case 'h': filed_print_help(stdout, 1, NULL); |
︙ |