~ubuntu-branches/ubuntu/maverick/pdns/maverick-updates

« back to all changes in this revision

Viewing changes to modules/opendbxbackend/odbxprivate.cc

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Haas
  • Date: 2009-02-25 23:25:51 UTC
  • mfrom: (1.1.7 upstream) (12.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090225232551-ts3d9k9q0ti442i9
Tags: 2.9.22-1
New upstream version (closes: #513409).

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
                m_handle[type] = NULL;
21
21
        }
22
22
 
 
23
        if( type == WRITE && getArg( "backend" ) == "sqlite" )
 
24
        {
 
25
                L.log( m_myname + " Using same SQLite connection for reading and writeing to '" + hosts[odbx_host_index[READ]] + "'", Logger::Notice );
 
26
                m_handle[WRITE] = m_handle[READ];
 
27
                return true;
 
28
        }
 
29
 
23
30
        for( i = 0; i < hosts.size(); i++ )
24
31
        {
25
32
                h = ( idx + i ) % hosts.size();
156
163
 
157
164
 
158
165
 
159
 
bool OdbxBackend::getDomainList( const string& stmt, vector<DomainInfo>* list, bool (*check_fcn)(u_int32_t,u_int32_t,SOAData*,DomainInfo*) )
 
166
bool OdbxBackend::getDomainList( const string& stmt, vector<DomainInfo>* list, bool (*check_fcn)(uint32_t,uint32_t,SOAData*,DomainInfo*) )
160
167
{
161
168
        const char* tmp;
162
 
        u_int32_t nlast, nserial;
 
169
        uint32_t nlast, nserial;
163
170
        DomainInfo di;
164
171
        SOAData sd;
165
172
 
188
195
 
189
196
                if( ( tmp = odbx_field_value( m_result, 4 ) ) != NULL )
190
197
                {
 
198
                        nserial = strtol( tmp, NULL, 10 );
 
199
                }
 
200
 
 
201
                if( ( tmp = odbx_field_value( m_result, 3 ) ) != NULL )
 
202
                {
191
203
                        nlast = strtol( tmp, NULL, 10 );
192
204
                }
193
205
 
194
 
                if( ( tmp = odbx_field_value( m_result, 3 ) ) != NULL )
195
 
                {
196
 
                        nserial = strtol( tmp, NULL, 10 );
197
 
                }
198
 
 
199
206
                if( (*check_fcn)( nlast, nserial, &sd, &di ) )
200
207
                {
201
208
                        if( ( tmp = odbx_field_value( m_result, 2 ) ) != NULL )
228
235
 
229
236
 
230
237
 
231
 
bool checkSlave( u_int32_t nlast, u_int32_t nserial, SOAData* sd, DomainInfo* di )
 
238
bool checkSlave( uint32_t nlast, uint32_t nserial, SOAData* sd, DomainInfo* di )
232
239
{
233
 
        if( nlast + sd->refresh < (u_int32_t) time( 0 ) )
 
240
        if( nlast + sd->refresh < (uint32_t) time( 0 ) )
234
241
        {
235
242
                di->kind = DomainInfo::Slave;
236
243
                return true;
241
248
 
242
249
 
243
250
 
244
 
bool checkMaster( u_int32_t nlast, u_int32_t nserial, SOAData* sd, DomainInfo* di )
 
251
bool checkMaster( uint32_t nlast, uint32_t nserial, SOAData* sd, DomainInfo* di )
245
252
{
246
253
        if( nserial != sd->serial )
247
254
        {