Revision cd580714 src/rm/RequestManagerZone.cc

View differences:

src/rm/RequestManagerZone.cc
55 55
        return;
56 56
    }
57 57

  
58
    if ( zone->add_servers(zs_tmpl, att.resp_msg) == -1 )
58
    if ( zone->add_server(zs_tmpl, att.resp_msg) == -1 )
59 59
    {
60 60
        failure_response(ACTION, att);
61 61

  
......
72 72
/* -------------------------------------------------------------------------- */
73 73
/* -------------------------------------------------------------------------- */
74 74

  
75
void ZoneDeleteServer::request_execute(xmlrpc_c::paramList const& paramList,
76
    RequestAttributes& att)
77
{
78
    int id    = xmlrpc_c::value_int(paramList.getInt(1));
79
    int zs_id = xmlrpc_c::value_int(paramList.getInt(2));
80

  
81
    string error_str;
82

  
83
    if ( basic_authorization(id, att) == false )
84
    {
85
        return;
86
    }
87

  
88
    Zone * zone = (static_cast<ZonePool *>(pool))->get(id, true);
89

  
90
    if ( zone == 0 )
91
    {
92
        att.resp_id = id;
93
        failure_response(NO_EXISTS, att);
94

  
95
        return;
96
    }
97

  
98
    if ( zone->delete_server(zs_id, att.resp_msg) == -1 )
99
    {
100
        failure_response(ACTION, att);
101
        zone->unlock();
102

  
103
        return;
104
    }
105

  
106
    pool->update(zone);
107

  
108
    zone->unlock();
109

  
110
    success_response(id, att);
111
}
112

  
113
/* -------------------------------------------------------------------------- */
114
/* -------------------------------------------------------------------------- */
115

  

Also available in: Unified diff