[mod-xhtml-neg-cvs] mod_xhtml_neg-2.0 mod_xhtml_neg.c,1.13,1.14
Brought to you by:
run2000
From: <ru...@us...> - 2004-03-28 06:07:55
|
Update of /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32106 Modified Files: mod_xhtml_neg.c Log Message: Resync with 1.x codebase to avoid code drift. Index: mod_xhtml_neg.c =================================================================== RCS file: /cvsroot/mod-xhtml-neg/mod_xhtml_neg-2.0/mod_xhtml_neg.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mod_xhtml_neg.c 26 Mar 2004 10:57:25 -0000 1.13 --- mod_xhtml_neg.c 28 Mar 2004 05:56:40 -0000 1.14 *************** *** 90,95 **** * @c XhtmlNegActive Is this module enabled? Defaults to no. \n * @c XhtmlNegLog A file name for an output log file \n ! * @c XhtmlNegTypes A file extension followed by one or more matching ! * content-type strings \n * @c XhtmlNegStarsIgnore The number of stars in an Accept token which should * be ignored if we match them \n --- 90,95 ---- * @c XhtmlNegActive Is this module enabled? Defaults to no. \n * @c XhtmlNegLog A file name for an output log file \n ! * @c XhtmlNegTypes A file extension followed by one or more matching ! * content-type strings \n * @c XhtmlNegStarsIgnore The number of stars in an Accept token which should * be ignored if we match them \n *************** *** 193,197 **** apr_array_header_t *extensions; /**< An array of extension_rec records */ int stars_ignore; /**< How many content-type stars before ! we ignore */ } xhtml_dir_config; --- 193,197 ---- apr_array_header_t *extensions; /**< An array of extension_rec records */ int stars_ignore; /**< How many content-type stars before ! * we ignore */ } xhtml_dir_config; *************** *** 703,707 **** { int old_weak, new_weak; - char *old_variable; if (mod_xhtml_strempty(old_variant)) { --- 703,706 ---- *************** *** 728,735 **** /* merge old and new variant_etags into a structured etag */ ! ! old_variable = apr_pstrdup( p, old_variant ); ! old_variable[strlen(old_variable) - 1] = '\0'; ! if ((new_weak) && (mod_xhtml_strlen(old_variable) > 3)) new_variant += 3; else --- 727,732 ---- /* merge old and new variant_etags into a structured etag */ ! old_variant[mod_xhtml_strlen(old_variant) - 1] = '\0'; ! if ((new_weak) && (mod_xhtml_strlen(new_variant) > 3)) new_variant += 3; else *************** *** 737,744 **** if((old_weak == 0) && (new_weak != 0)) { ! return apr_pstrcat(p, "W/", old_variable, ";", new_variant, NULL); } ! return apr_pstrcat(p, old_variable, ";", new_variant, NULL); } --- 734,741 ---- if((old_weak == 0) && (new_weak != 0)) { ! return apr_pstrcat(p, "W/", old_variant, ";", new_variant, NULL); } ! return apr_pstrcat(p, old_variant, ";", new_variant, NULL); } *************** *** 775,779 **** /** * Get a single mime type entry --- one media type and parameters; ! * enter the values we recognize into the argument accept_rec * * @param p a memory pool from which we can allocate temporary memory for this --- 772,776 ---- /** * Get a single mime type entry --- one media type and parameters; ! * enter the values we recognize into the argument accept_rec. * * @param p a memory pool from which we can allocate temporary memory for this *************** *** 870,874 **** /** ! * Deal with Accept header lines. * * The Accept request header is handled by do_accept_line() - it has the --- 867,871 ---- /** ! * Parse and tokenise Accept header lines. * * The Accept request header is handled by do_accept_line() - it has the *************** *** 910,914 **** /** ! * Deal explicitly with Accept-Charset headers. There is an extra record * inserted when neither "*" nor "ISO-8859-1" are mentioned. * --- 907,911 ---- /** ! * Parse and tokenise Accept-Charset headers. There is an extra record * inserted when neither "*" nor "ISO-8859-1" are mentioned. * *************** *** 1285,1291 **** /** ! * The main routine for the content-negotiation phase of this module ! * goes here. This is mainly setup, control flow and logging going on ! * here. * * Note that due to the way we hook into the Apache handler system means --- 1282,1287 ---- /** ! * The main routine for the content-negotiation phase of this module goes ! * here. This is mainly setup, control flow and logging going on here. * * Note that due to the way we hook into the Apache handler system means *************** *** 1323,1326 **** --- 1319,1331 ---- }; + /* Return OK if either active isn't ON, or stars_ignore is 0. */ + if( conf->active != active_on ) { + return DECLINED; + } + + if( conf->stars_ignore == 0 ) { + return DECLINED; + } + /* Only service requests for GET or HEAD methods. */ if( r->method_number != M_GET ) { *************** *** 1400,1404 **** r->content_type = reconstruct_content_type( r->pool, result_rec ); r->vlist_validator = merge_validators( r->pool, r->vlist_validator, ! result_rec->hashcode ); if( xns->log_fd != NULL ) { --- 1405,1409 ---- r->content_type = reconstruct_content_type( r->pool, result_rec ); r->vlist_validator = merge_validators( r->pool, r->vlist_validator, ! result_rec->hashcode ); if( xns->log_fd != NULL ) { *************** *** 1504,1508 **** char *content_type = apr_pstrdup( cmd->pool, type ); ! /* Probably don't want this bit... */ /* if (*ext == '.') --- 1509,1513 ---- char *content_type = apr_pstrdup( cmd->pool, type ); ! /* Probably don't need this bit... */ /* if (*ext == '.') *************** *** 1528,1532 **** /** ! * Note the minimun number of stars in an Accept token that should be * ignored when performing negotiation. * --- 1533,1537 ---- /** ! * Set the minimun number of stars in an Accept token that should be * ignored when performing negotiation. * |