Changeset 5767:c224fd65739a in roaraudio for plugins/universal/protocol-http.c
- Timestamp:
- 11/21/12 17:27:31 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/universal/protocol-http.c
r5738 r5767 110 110 } 111 111 112 static const char * __res_vio_content_type_get(struct http_client * self ) {113 const char * point = strrchr( self->path, '.');112 static const char * __res_vio_content_type_get(struct http_client * self, const char * indexfile) { 113 const char * point = strrchr(indexfile != NULL ? indexfile : self->path, '.'); 114 114 115 115 if ( point == NULL ) … … 335 335 } 336 336 337 static void __res_vio_handle_uste(struct http_client * self, struct roar_buffer ** obuffer, const char * content_type ) {337 static void __res_vio_handle_uste(struct http_client * self, struct roar_buffer ** obuffer, const char * content_type, const char * filename) { 338 338 struct roar_buffer * buffer = NULL; 339 339 uste_renderer_t renderer; … … 344 344 345 345 346 parser = uste_parser_new(self->input.vio );346 parser = uste_parser_new(self->input.vio, filename); 347 347 err = roar_error; 348 348 roar_vio_close(self->input.vio); … … 460 460 int uste_check; 461 461 size_t i; 462 const char * indexfile = NULL; 462 463 463 464 if ( self->pluginpara == NULL ) { … … 493 494 uste_check = -1; 494 495 for (i = 0; uste_check == -1 && i < (sizeof(index_files)/sizeof(*index_files)); i++) { 496 indexfile = index_files[i]; 497 495 498 snprintf(filename, sizeof(filename), "%s%s%s%s%s", path->value, slash, self->path, 496 index _files[i]== NULL ? "" : "/",497 index _files[i] == NULL ? "" : index_files[i]);499 indexfile == NULL ? "" : "/", 500 indexfile == NULL ? "" : indexfile); 498 501 499 502 … … 507 510 508 511 if ( content_type == NULL ) 509 content_type = __res_vio_content_type_get(self );512 content_type = __res_vio_content_type_get(self, indexfile); 510 513 511 514 uste_check = __res_vio_check_uste(self, &buffer, content_type); … … 521 524 roar_buffer_free(buffer); 522 525 #ifdef ROAR_HAVE_LIBUSTE 523 __res_vio_handle_uste(self, obuffer, content_type );526 __res_vio_handle_uste(self, obuffer, content_type, filename); 524 527 return 0; 525 528 #else
Note: See TracChangeset
for help on using the changeset viewer.