You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Arfrever Frehtes Taifersar Arahesis <ar...@gmail.com> on 2008/04/16 15:01:04 UTC

Re: svn commit: r30629 - trunk/contrib/server-side/mod_dontdothat

2008-04-16 16:47 jerenkrantz@tigris.org <je...@tigris.org> napisaƂ(a):
> Author: jerenkrantz
>  Date: Wed Apr 16 07:47:57 2008
>  New Revision: 30629
>
>  Log:
>  Allow opt-out of replay rejections.
>
>  * mod_dontdothat/mod_dontdothat.c:
>   (dontdothat_config_rec): Add no_replay flag to config entry.
>   (create_dontdothat_dir_config): Initialize to 1.
>   (start_element): respect no_replay in config when rejecting replay requests.
>  * mod_dontdothat/README:
>   Document the DontDoThatDisallowReplay directive.
>
>  Submitted by: clkao
>  Reviewed/tweaked by: jerenkrantz
>
>  Modified:
>    trunk/contrib/server-side/mod_dontdothat/README
>    trunk/contrib/server-side/mod_dontdothat/mod_dontdothat.c
>
>  Modified: trunk/contrib/server-side/mod_dontdothat/README
>  URL: http://svn.collab.net/viewvc/svn/trunk/contrib/server-side/mod_dontdothat/README?pathrev=30629&r1=30628&r2=30629
>  ==============================================================================
>  --- trunk/contrib/server-side/mod_dontdothat/README     Wed Apr 16 06:34:53 2008        (r30628)
>  +++ trunk/contrib/server-side/mod_dontdothat/README     Wed Apr 16 07:47:57 2008        (r30629)
>  @@ -20,6 +20,7 @@ It is enabled via single httpd.conf dire
>    DAV svn
>    SVNParentPath /path/to/repositories
>    DontDoThatConfigFile /path/to/config.file
>  +  DontDoThatDisallowReplay off
>   </Location>
>
>   The file you give to DontDoThatConfigFile is a Subversion configuration file
>  @@ -47,3 +48,6 @@ a directory segment, so /foo* or /* are
>   These rules are applied to any recursive action, which basically means any
>   Subversion command that goes through the update-report, like update, diff,
>   checkout, merge, etc.
>  +
>  +The DontDoThatDisallowReplay option makes mod_dontdothat disallow
>  +replay requests, wihch is on by default.

s/wihch/which/

>
>  Modified: trunk/contrib/server-side/mod_dontdothat/mod_dontdothat.c
>  URL: http://svn.collab.net/viewvc/svn/trunk/contrib/server-side/mod_dontdothat/mod_dontdothat.c?pathrev=30629&r1=30628&r2=30629
>  ==============================================================================
>  --- trunk/contrib/server-side/mod_dontdothat/mod_dontdothat.c   Wed Apr 16 06:34:53 2008        (r30628)
>  +++ trunk/contrib/server-side/mod_dontdothat/mod_dontdothat.c   Wed Apr 16 07:47:57 2008        (r30629)
>  @@ -37,6 +37,7 @@ module AP_MODULE_DECLARE_DATA dontdothat
>   typedef struct {
>    const char *config_file;
>    const char *base_path;
>  +  int no_replay;
>   } dontdothat_config_rec;
>
>   static void *create_dontdothat_dir_config(apr_pool_t *pool, char *dir)
>  @@ -44,6 +45,7 @@ static void *create_dontdothat_dir_confi
>    dontdothat_config_rec *cfg = apr_pcalloc(pool, sizeof(*cfg));
>
>    cfg->base_path = dir;
>  +  cfg->no_replay = 1;
>
>    return cfg;
>   }
>  @@ -54,6 +56,9 @@ static const command_rec dontdothat_cmds
>                  (void *) APR_OFFSETOF(dontdothat_config_rec, config_file),
>                  OR_ALL,
>                  "Text file containing actions to take for specific requests"),
>  +  AP_INIT_FLAG("DontDoThatDisallowReplay",  ap_set_flag_slot,
>  +                (void *) APR_OFFSETOF(dontdothat_config_rec, no_replay),
>  +                OR_ALL, "Disallow replay requests as if they are other recursive requests."),
>    { NULL }
>   };
>
>  @@ -365,7 +370,7 @@ start_element(void *baton, const char *n
>        case STATE_BEGINNING:
>          if (strcmp(name, "update-report") == 0)
>            ctx->state = STATE_IN_UPDATE;
>  -        else if (strcmp(name, "replay-report") == 0)
>  +        else if (strcmp(name, "replay-report") == 0 && ctx->cfg->no_replay)
>            {
>              /* XXX it would be useful if there was a way to override this
>               *     on a per-user basis... */
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
>  For additional commands, e-mail: svn-help@subversion.tigris.org
>
>