cvs commit: apache/src mod_negotiation.c

1997-11-05 Thread dgaudet
dgaudet 97/11/05 03:48:31

  Modified:src  Tag: APACHE_1_2_X mod_negotiation.c
  Log:
  Fix undefined C behaviour.
  
  Submitted by: Ben Laurie
  Reviewed by:  Dean Gaudet, Ralf Engelschall
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.40.2.3  +3 -2  apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.40.2.2
  retrieving revision 1.40.2.3
  diff -u -r1.40.2.2 -r1.40.2.3
  --- mod_negotiation.c 1997/07/19 08:17:16 1.40.2.2
  +++ mod_negotiation.c 1997/11/05 11:48:30 1.40.2.3
  @@ -623,8 +623,9 @@
   {
   char *cp = header;
   
  -while (*cp  *cp != ':')
  -*cp++ = tolower(*cp);
  +for ( ; *cp  *cp != ':' ; ++cp) {
  +*cp = tolower(*cp);
  +}
   
   if (!*cp) {
log_reason (Syntax error in type map --- no ':', r-filename, r);
  
  
  


cvs commit: apache/src mod_negotiation.c

1997-02-06 Thread Marc Slemko
marc97/02/06 23:13:16

  Modified:src   mod_negotiation.c
  Log:
  handle_multi() was not setting content_language.
  
  Submitted by: Petr Lampa [EMAIL PROTECTED]
  Reviewed by: Paul Sutton, Marc Slemko, Dean Gaudet
  
  Revision  ChangesPath
  1.32  +1 -0  apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -C3 -r1.31 -r1.32
  *** mod_negotiation.c 1997/02/07 06:36:07 1.31
  --- mod_negotiation.c 1997/02/07 07:13:15 1.32
  ***
  *** 1940,1945 
  --- 1940,1946 
r-content_type = sub_req-content_type;
r-content_encoding = sub_req-content_encoding;
r-content_languages = sub_req-content_languages;
  + r-content_language = sub_req-content_language;
r-finfo = sub_req-finfo;

return OK;
  
  
  


cvs commit: apache/src mod_negotiation.c

1996-12-21 Thread Brian Behlendorf
brian   96/12/21 19:47:16

  Modified:src   mod_negotiation.c
  Log:
  Reviewed by:  Randy Terbush, Brian Behlendorf
  Submitted by: Paul Sutton
  
  Change name of #define to make it clear this complies with draft 02 of Koen's
  conneg proposal.
  
  Revision  ChangesPath
  1.28  +3 -3  apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -C3 -r1.27 -r1.28
  *** mod_negotiation.c 1996/12/09 04:37:03 1.27
  --- mod_negotiation.c 1996/12/22 03:47:14 1.28
  ***
  *** 63,76 
#include http_core.h
#include http_log.h

  ! /* define HOLTMAN to allow for Holtman I-D transparent negotiation.
 * This file currently implements the draft-02, except for
 * anything to do with features and cache-control (max-age etc)
 *
 * Since the draft is just that, and we don't yet implement
 * everything, regard the transparent negotiation stuff as experimental.
 */
  ! /*#define HOLTMAN*/

/* Commands --- configuring document caching on a per (virtual?)
 * server basis...
  --- 63,76 
#include http_core.h
#include http_log.h

  ! /* define TCN_02 to allow for Holtman I-D transparent negotiation.
 * This file currently implements the draft-02, except for
 * anything to do with features and cache-control (max-age etc)
 *
 * Since the draft is just that, and we don't yet implement
 * everything, regard the transparent negotiation stuff as experimental.
 */
  ! /*#define TCN_02*/

/* Commands --- configuring document caching on a per (virtual?)
 * server basis...
  ***
  *** 455,461 
  do_header_line (r-pool, table_get (hdrs, Accept-charset));
new-avail_vars = make_array (r-pool, 40, sizeof (var_rec));

  ! #ifdef HOLTMAN
if (table_get(r-headers_in, Negotiate)) {
/* Negotiate: header tells us UA does transparent negotiation
 * We have to decide whether we want to ... for now, yes,
  --- 455,461 
  do_header_line (r-pool, table_get (hdrs, Accept-charset));
new-avail_vars = make_array (r-pool, 40, sizeof (var_rec));

  ! #ifdef TCN_02
if (table_get(r-headers_in, Negotiate)) {
/* Negotiate: header tells us UA does transparent negotiation
 * We have to decide whether we want to ... for now, yes,
  
  
  


cvs commit: apache/src mod_negotiation.c

1996-12-08 Thread Brian Behlendorf
brian   96/12/08 19:56:26

  Modified:src   mod_negotiation.c
  Log:
  Typo.
  
  Revision  ChangesPath
  1.26  +1 -1  apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -C3 -r1.25 -r1.26
  *** mod_negotiation.c 1996/12/01 20:29:17 1.25
  --- mod_negotiation.c 1996/12/09 03:56:24 1.26
  ***
  *** 1062,1068 

}
else if (naccept) {
  ! /* Variant has one (or more) langauges, and we have one (or more)
 * language ranges on the Accept-Language header. Look for
 * the best match. We do this by going through each language
 * on the variant description looking for a match on the
  --- 1062,1068 

}
else if (naccept) {
  ! /* Variant has one (or more) languages, and we have one (or more)
 * language ranges on the Accept-Language header. Look for
 * the best match. We do this by going through each language
 * on the variant description looking for a match on the
  
  
  


cvs commit: apache/src mod_negotiation.c

1996-10-29 Thread Paul Sutton
pcs 96/10/29 07:23:05

  Modified:src   mod_negotiation.c
  Log:
  Reviewed By: Brian Behlendorf, Jim Jagielski
  
  Update mod_negotation.c to support variants with multiple language
  types. Languages can either be obtained from file extensions
  (eg foo.fr.en.html) or on the Content-Language line in a type-map
  file (eg Content-Language: fr, en).
  
  This patch:
  
  * Allows multiple comma separated languages on the Content-Language:
header in a type-map file
  
  * Updates the function which sets the language quality factor for
each variant to select the best (highest q) match from the tags
of the variant, using the algorithm in HTTP/1.1 14.4
  
  * If the new (HTTP/1.1) language negotiation results in a tie between
variants, falls back onto the Apache 1.1 language negotiation
algorythm, using _just_ the first language of the variant
  
  * Updates the 406 text and Alternates header to list multiple languages
if necessary
  
  Revision  ChangesPath
  1.23  +174 -89   apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -C3 -r1.22 -r1.23
  *** mod_negotiation.c 1996/10/28 16:28:17 1.22
  --- mod_negotiation.c 1996/10/29 15:23:03 1.23
  ***
  *** 82,87 
  --- 82,98 

module negotiation_module;

  + char *merge_string_array (pool *p, array_header *arr, char *sep)
  + {
  + int i;
  + char *t = ;
  + 
  + for (i = 0; i  arr-nelts; i++) {
  + t = pstrcat(p, t, i ? sep : , ((char**)arr-elts)[i], NULL);
  + }
  + return t;
  + }
  + 
void *create_neg_dir_config (pool *p, char *dummy)
{
neg_dir_config *new =
  ***
  *** 162,168 
char *type_name;
char *file_name;
char *content_encoding;
  ! char *content_language;
char *content_charset;
char *description;

  --- 173,179 
char *type_name;
char *file_name;
char *content_encoding;
  ! array_header *content_languages; /* list of languages for this variant 
*/
char *content_charset;
char *description;

  ***
  *** 230,236 
mime_info-type_name = ;
mime_info-file_name = ;
mime_info-content_encoding = ;
  ! mime_info-content_language = ;
mime_info-content_charset = ;
mime_info-description = ;

  --- 241,247 
mime_info-type_name = ;
mime_info-file_name = ;
mime_info-content_encoding = ;
  ! mime_info-content_languages = NULL;
mime_info-content_charset = ;
mime_info-description = ;

  ***
  *** 392,397 
  --- 403,429 
return accept_recs;
}

  + /* Given the text of the Content-Languages: line from the var map file,
  +  * return an array containing the languages of this variant
  +  */
  + 
  + array_header *do_languages_line (pool *p, char **lang_line)
  + {
  + array_header *lang_recs = make_array (p, 2, sizeof (char *));
  +   
  + if (!lang_line) return lang_recs;
  + 
  + while (**lang_line) {
  + char **new = (char **)push_array (lang_recs);
  + *new = get_token (p, lang_line, 0);
  + str_tolower (*new);
  + if (**lang_line == ',')
  + ++(*lang_line);
  + }
  + 
  + return lang_recs;
  + }
  + 
/*
 *
 * Handling header lines from clients...
  ***
  *** 648,655 
mime_info.bytes = atoi(body);
}
else if (!strncmp (buffer, content-language:, 17)) {
  ! mime_info.content_language = get_token (neg-pool, body, 0);
  ! str_tolower (mime_info.content_language);
}
else if (!strncmp (buffer, content-encoding:, 17)) {
mime_info.content_encoding = get_token (neg-pool, body, 0);
  --- 680,687 
mime_info.bytes = atoi(body);
}
else if (!strncmp (buffer, content-language:, 17)) {
  ! mime_info.content_languages = 
  ! do_languages_line(neg-pool, body);
}
else if (!strncmp (buffer, content-encoding:, 17)) {
mime_info.content_encoding = get_token (neg-pool, body, 0);
  ***
  *** 756,764 
mime_info.content_encoding = sub_req-content_encoding;
str_tolower(mime_info.content_encoding);
}
  ! if (sub_req-content_language) {
  ! mime_info.content_language = sub_req-content_language;
  ! str_tolower(mime_info.content_language);
}

get_entry (neg-pool, accept_info, sub_req-content_type);
  --- 788,800 
mime_info.content_encoding = 

cvs commit: apache/src mod_negotiation.c

1996-08-15 Thread Alexei Kosut
akosut  96/08/15 13:15:44

  Modified:src   mod_negotiation.c
  Log:
  In the absense of other considerations, cause Apache to send the smallest
  variant, even if the types are different (Accept-header order should not
  make a difference - the client would have sent us a q-value if it cared).
  
  Revision  ChangesPath
  1.16  +1 -3  apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -C3 -r1.15 -r1.16
  *** mod_negotiation.c 1996/08/15 20:12:10 1.15
  --- mod_negotiation.c 1996/08/15 20:15:42 1.16
  ***
  *** 1026,1036 
|| (variant-lang_index == best-lang_index
 ((levcmp = level_cmp (variant, best)) == 1
|| (levcmp == 0
  -  !strcmp (variant-type_name,
  - best-type_name)
 (find_content_length(neg, variant)

  ! find_content_length(neg, best)
{
best = variant;
best_quality = q;
  --- 1026,1034 
|| (variant-lang_index == best-lang_index
 ((levcmp = level_cmp (variant, best)) == 1
|| (levcmp == 0
 (find_content_length(neg, variant)

  !  find_content_length(neg, best)
{
best = variant;
best_quality = q;
  
  
  


cvs commit: apache/src mod_negotiation.c

1996-07-28 Thread Chuck Murcko
chuck   96/07/28 15:40:56

  Modified:src   mod_negotiation.c
  Log:
  Reviewed by:  Chuck Murcko
  Submitted by: Ralf S. Engelschall
  Prevent conflicts when ProxyRemote is in use
  
  Revision  ChangesPath
  1.11  +3 -0  apache/src/mod_negotiation.c
  
  Index: mod_negotiation.c
  ===
  RCS file: /export/home/cvs/apache/src/mod_negotiation.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -C3 -r1.10 -r1.11
  *** mod_negotiation.c 1996/07/28 19:27:49 1.10
  --- mod_negotiation.c 1996/07/28 22:40:55 1.11
  ***
  *** 593,598 
  --- 593,601 

if (!(filp = strrchr (r-filename, '/'))) return DECLINED; /* Weird... 
*/

  + if (strncmp(r-filename, proxy:, 6) == 0)
  + return DECLINED;
  + 
++filp;
prefix_len = strlen (filp);