Changeset 5767:c224fd65739a in roaraudio


Ignore:
Timestamp:
11/21/12 17:27:31 (11 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

updates for current uste version, corrections for mimetype detection in case index files are used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/universal/protocol-http.c

    r5738 r5767  
    110110} 
    111111 
    112 static const char * __res_vio_content_type_get(struct http_client * self) { 
    113  const char * point = strrchr(self->path, '.'); 
     112static const char * __res_vio_content_type_get(struct http_client * self, const char * indexfile) { 
     113 const char * point = strrchr(indexfile != NULL ? indexfile : self->path, '.'); 
    114114 
    115115 if ( point == NULL ) 
     
    335335} 
    336336 
    337 static void __res_vio_handle_uste(struct http_client * self, struct roar_buffer ** obuffer, const char * content_type) { 
     337static void __res_vio_handle_uste(struct http_client * self, struct roar_buffer ** obuffer, const char * content_type, const char * filename) { 
    338338 struct roar_buffer * buffer = NULL; 
    339339 uste_renderer_t renderer; 
     
    344344 
    345345 
    346  parser = uste_parser_new(self->input.vio); 
     346 parser = uste_parser_new(self->input.vio, filename); 
    347347 err = roar_error; 
    348348 roar_vio_close(self->input.vio); 
     
    460460 int uste_check; 
    461461 size_t i; 
     462 const char * indexfile = NULL; 
    462463 
    463464 if ( self->pluginpara == NULL ) { 
     
    493494 uste_check = -1; 
    494495 for (i = 0; uste_check == -1 && i < (sizeof(index_files)/sizeof(*index_files)); i++) { 
     496  indexfile = index_files[i]; 
     497 
    495498  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); 
    498501 
    499502 
     
    507510 
    508511  if ( content_type == NULL ) 
    509    content_type = __res_vio_content_type_get(self); 
     512   content_type = __res_vio_content_type_get(self, indexfile); 
    510513 
    511514  uste_check = __res_vio_check_uste(self, &buffer, content_type); 
     
    521524   roar_buffer_free(buffer); 
    522525#ifdef ROAR_HAVE_LIBUSTE 
    523   __res_vio_handle_uste(self, obuffer, content_type); 
     526  __res_vio_handle_uste(self, obuffer, content_type, filename); 
    524527  return 0; 
    525528#else 
Note: See TracChangeset for help on using the changeset viewer.