Changeset 117 in Main
- Timestamp:
- Sep 21, 2024, 5:47:51 PM (8 weeks ago)
- Location:
- trunk/Server
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/main.c
r116 r117 113 113 } 114 114 confpath = argv[i]; 115 } else if(strcmp(argv[i], "--logfile") == 0 || strcmp(argv[i], "-l") == 0) { 116 i++; 117 if(argv[i] == NULL) { 118 fprintf(stderr, "Missing argument\n"); 119 return 1; 120 } 121 if(logfile != NULL && logfile != stderr) { 122 fclose(logfile); 123 } 124 logfile = fopen(argv[i], "a"); 125 if(logfile == NULL) { 126 fprintf(stderr, "Failed to open logfile\n"); 127 return 1; 128 } 115 129 } else if(strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-V") == 0) { 116 130 printf("Tewi HTTPd Tewi/%s\n", tw_get_version()); -
trunk/Server/server.c
r116 r117 457 457 458 458 int i; 459 for(i = 0; req.headers[i] != NULL; i += 2) {460 if(cm_strcaseequ(req.headers[i], "User-Agent")) {459 for(i = 0; req.headers[i] != NULL; i += 2) { 460 if(cm_strcaseequ(req.headers[i], "User-Agent")) { 461 461 free(useragent); 462 462 useragent = cm_strdup(req.headers[i + 1]);
Note:
See TracChangeset
for help on using the changeset viewer.