Changeset 443

Show
Ignore:
Timestamp:
07/12/2005 06:25:18 PM (3 years ago)
Author:
jan
Message:

replace spaces by _ for memcache

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.3.x/src/mod_trigger_b4_dl.c

    r436 r443  
    351351                 
    352352                remote_ip = ds->value->ptr; 
     353                 
     354                /* memcache can't handle spaces */ 
    353355        } else { 
    354356                remote_ip = inet_ntop_cache_get_ip(srv, &(con->dst_addr)); 
     
    385387                        buffer_copy_string_buffer(p->tmp_buf, p->conf.mc_namespace); 
    386388                        buffer_append_string(p->tmp_buf, remote_ip); 
     389                         
     390                        for (i = 0; i < p->tmp_buf->used - 1; i++) { 
     391                                if (p->tmp_buf->ptr[i] == ' ') p->tmp_buf->ptr[i] = '-'; 
     392                        } 
    387393                         
    388394                        if (0 != mc_set(p->conf.mc,  
     
    441447                                                                "delete failed"); 
    442448                                        } 
    443                                 } else if (p->conf.mc) { 
    444                                         if (0 != mc_delete(p->conf.mc,  
    445                                                            (char *)remote_ip, strlen(remote_ip), 
    446                                                            0)) { 
    447                                                 log_error_write(srv, __FILE__, __LINE__, "s", 
    448                                                                 "insert failed"); 
    449                                         } 
    450449                                } 
    451450                                 
     
    469468                        buffer_copy_string_buffer(p->tmp_buf, p->conf.mc_namespace); 
    470469                        buffer_append_string(p->tmp_buf, remote_ip); 
     470                         
     471                        for (i = 0; i < p->tmp_buf->used - 1; i++) { 
     472                                if (p->tmp_buf->ptr[i] == ' ') p->tmp_buf->ptr[i] = '-'; 
     473                        } 
    471474                         
    472475                        /**