273 if(stat(file->file.ptr, &s) != 0) { |
273 if(stat(file->file.ptr, &s) != 0) { |
274 perror("object_conf_reload: stat"); |
274 perror("object_conf_reload: stat"); |
275 return -1; |
275 return -1; |
276 } |
276 } |
277 file->last_modified = s.st_mtim.tv_sec; |
277 file->last_modified = s.st_mtim.tv_sec; |
|
278 return 0; |
278 } |
279 } |
279 |
280 |
280 HTTPObjectConfig* load_obj_conf(char *file) { |
281 HTTPObjectConfig* load_obj_conf(char *file) { |
281 printf("load_obj_conf\n"); |
282 printf("load_obj_conf\n"); |
282 |
283 |
313 |
314 |
314 /* create and add object */ |
315 /* create and add object */ |
315 httpd_object *obj = object_new(name); |
316 httpd_object *obj = object_new(name); |
316 obj->path = NULL; |
317 obj->path = NULL; |
317 |
318 |
318 conf->objects[i] = obj; |
319 conf->objects[i] = obj; // TODO: beyond array bounds write |
319 |
320 |
320 /* add directives */ |
321 /* add directives */ |
321 for(int i=0;i<6;i++) { |
322 for(int i=0;i<6;i++) { |
322 UcxDlist *dirs = cob->directives[i]; |
323 UcxDlist *dirs = cob->directives[i]; |
323 while(dirs != NULL) { |
324 while(dirs != NULL) { |