httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guill...@clipper.ens.fr (Florent Guillaume)
Subject Re: Patches to handle content-language
Date Tue, 18 Jul 1995 12:57:05 GMT
Oops, I overlooked a small thing : if not all the languages were named
in LanguagePriority, you got incorrect behaviour.  Please apply this
patch as well over my previous one.

	Florent

*** apache_0.8.1/src/mod_negotiation.c	Tue Jul 18 00:22:28 1995
--- apache_0.8.1.new/src/mod_negotiation.c	Tue Jul 18 14:41:57 1995
***************
*** 842,865 ****
      var_rec *var_recs = (var_rec*)neg->avail_vars->elts;
      int i;
      int found_any = 0;
  
!     if (neg->accept_langs->nelts == 0) {
  
- 	/* Client doesn't care : use LanguagePriority order */
- 
- 	neg_dir_config *conf =
- 	    (neg_dir_config *) get_module_config (neg->r->per_dir_config,
- 						  &negotiation_module);
- 	for (i = 0; i < neg->avail_vars->nelts; ++i)
- 	    var_recs[i].lang_index =
- 		find_default_index (conf, var_recs[i].content_language);
- 
- 	return;
-     }
-     
      for (i = 0; i < neg->avail_vars->nelts; ++i)
  	if (var_recs[i].quality > 0) {
! 	    int index = find_lang_index (neg->accept_langs,
  					 var_recs[i].content_language);
  
  	    var_recs[i].lang_index = index;
--- 842,862 ----
      var_rec *var_recs = (var_rec*)neg->avail_vars->elts;
      int i;
      int found_any = 0;
+     neg_dir_config *conf;
+     int naccept = neg->accept_langs->nelts;
  
!     if (naccept == 0)
! 	conf = (neg_dir_config *) get_module_config (neg->r->per_dir_config,
! 						     &negotiation_module);
  
      for (i = 0; i < neg->avail_vars->nelts; ++i)
  	if (var_recs[i].quality > 0) {
! 	    int index;
! 	    if (naccept == 0)		/* Client doesn't care */
! 		index = find_default_index (conf,
! 					    var_recs[i].content_language);
! 	    else			/* Client has Accept-Language */
! 		index = find_lang_index (neg->accept_langs,
  					 var_recs[i].content_language);
  
  	    var_recs[i].lang_index = index;

Mime
View raw message