Changeset 1114

Show
Ignore:
Timestamp:
12/12/07 07:52:49 (2 years ago)
Author:
ahu
Message:

apply patch by David Apgar to support the 'FAIL' command, plus add supports for spaces in the pipe backend protocol

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/modules/pipebackend/pipebackend.cc

    r1060 r1114  
    200200         throw AhuException("Format error communicating with coprocess"); 
    201201      } 
     202      else if(parts[0]=="FAIL") { 
     203         throw DBException("coprocess returned a FAIL"); 
     204      } 
    202205      else if(parts[0]=="END") { 
    203206         return false; 
     
    217220         r.ttl=atoi(parts[4].c_str()); 
    218221         r.domain_id=atoi(parts[5].c_str()); 
    219  
    220          if(parts[3]!="MX") 
    221            r.content=parts[6]; 
     222  
     223         if(parts[3]!="MX") { 
     224           r.content.clear(); 
     225           for(int n=6; n < parts.size(); ++n) { 
     226             if(n!=6) 
     227               r.content.append(1,' '); 
     228             r.content.append(parts[n]); 
     229           } 
     230         } 
    222231         else { 
    223232           if(parts.size()<8) { 
     
    228237           r.priority=atoi(parts[6].c_str()); 
    229238           r.content=parts[7]; 
     239 
    230240         } 
    231241         break;