Show
Ignore:
Timestamp:
09/11/08 20:00:53 (4 months ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/cherokee/config_entry.c

    r1880 r1975  
    2929#include "http.h" 
    3030#include "util.h" 
     31#include "encoder.h" 
    3132 
    3233#define ENTRIES "config,rules" 
     
    3738        table_validator 
    3839} prop_table_types_t; 
    39  
     40         
    4041 
    4142/* Implements _new() and _free()  
     
    6667        entry->expiration_time      = 0; 
    6768 
     69        entry->encoders             = NULL; 
     70 
    6871        return ret_ok; 
    6972} 
     
    102105                entry->users = NULL; 
    103106        } 
    104  
    105         return ret_ok; 
    106 
    107  
    108  
    109 ret_t  
    110 cherokee_config_entry_set_handler (cherokee_config_entry_t *entry, cherokee_plugin_info_handler_t *plugin_info) 
     107         
     108        if (entry->encoders) { 
     109                cherokee_avl_mrproper (entry->encoders, NULL); 
     110                entry->encoders = NULL; 
     111        } 
     112 
     113        return ret_ok; 
     114
     115 
     116ret_t 
     117cherokee_config_entry_add_encoder (cherokee_config_entry_t *entry,  
     118                                   cherokee_buffer_t       *name, 
     119                                   cherokee_plugin_info_t  *plugin_info) 
     120
     121        if (entry->encoders == NULL) { 
     122                cherokee_avl_new (&entry->encoders); 
     123        } 
     124 
     125        cherokee_avl_add (entry->encoders, name, (void*)plugin_info->instance); 
     126        return ret_ok; 
     127
     128 
     129 
     130ret_t  
     131cherokee_config_entry_set_handler (cherokee_config_entry_t        *entry, 
     132                                   cherokee_plugin_info_handler_t *plugin_info) 
    111133{ 
    112134        return_if_fail (plugin_info != NULL, ret_error); 
     
    169191                entry->expiration_time = source->expiration_time; 
    170192        } 
     193 
     194        if (! entry->encoders) 
     195                entry->encoders = source->encoders; 
    171196 
    172197        return ret_ok; 
     
    189214        printf ("expiration type:           %d\n", entry->expiration); 
    190215        printf ("expiration_time            %lu\n", entry->expiration_time); 
    191  
    192         return ret_ok; 
    193 
     216        printf ("encoders_accepted          %p\n", entry->encoders); 
     217 
     218        return ret_ok; 
     219