Changeset 27281 for lang/c

Show
Ignore:
Timestamp:
12/23/08 14:21:39 (4 years ago)
Author:
frsyuki
Message:

lang/c/memstored: binary protocol: support noop and flush command

Location:
lang/c/memstored/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/c/memstored/trunk/src/binproto.cc

    r27279 r27281  
    4646                NULL,        // decrement 
    4747                NULL,        // quit 
    48                 NULL,//cmd_flush,   // flush 
     48                cmd_flush,   // flush 
    4949                cmd_get,     // getq 
    50                 NULL,//cmd_noop,    // noop 
     50                cmd_noop,    // noop 
    5151                NULL,        // version 
    5252                cmd_get,     // getk 
     
    185185} 
    186186 
     187void MemprotoBinary::flush(auto_bufref_t ref, 
     188                memproto_header* h, 
     189                uint32_t expiration) 
     190{ 
     191        if(expiration != 0) { 
     192                send_response_nodata(h, MEMPROTO_RES_INVALID_ARGUMENTS, 0); 
     193                return; 
     194        } 
     195        send_response_nodata(h, MEMPROTO_RES_NO_ERROR, 0); 
     196} 
     197 
     198void MemprotoBinary::noop(auto_bufref_t ref, 
     199                memproto_header* h) 
     200{ 
     201        send_response_nodata(h, MEMPROTO_RES_NO_ERROR, 0); 
     202} 
    187203 
    188204 
  • lang/c/memstored/trunk/src/binproto.h

    r27279 r27281  
    6262        { SUBMIT(del, h, key, keylen, expiration); } 
    6363 
     64        static void cmd_flush(void* self, memproto_header* h, 
     65                        uint32_t expiration) 
     66        { SUBMIT(flush, h, expiration); } 
     67 
     68        static void cmd_noop(void* self, memproto_header* h) 
     69        { SUBMIT(noop, h); } 
     70 
    6471 
    6572        void get(auto_bufref_t ref, 
     
    8289                        const char* key, uint16_t keylen, 
    8390                        uint32_t expiration); 
     91 
     92        void flush(auto_bufref_t ref, 
     93                        memproto_header* h, 
     94                        uint32_t expiration); 
     95 
     96        void noop(auto_bufref_t ref, 
     97                        memproto_header* h); 
    8498 
    8599private: