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

« back to all changes in this revision

Viewing changes to pdns/session.cc

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Mohlmann, Matthijs Mohlmann, Christoph Haas
  • Date: 2007-04-15 23:23:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070415232339-5x3scc8gx04e50um
Tags: 2.9.21-1
[ Matthijs Mohlmann ]
* New upstream release. (Closes: #420294)
* Remove meta pdns package.
* Added new sqlite3 backend package.
* Months and minutes where mixed up. (Closes: #406462)
* Case sensitivity in bind backend caused PowerDNS to not serve a certain
  zone. (Closes: #406461)
* Bind backend forgot about zones on a notify. (Closes: #398213)

[ Christoph Haas ]
* Documented incorporated backend bind. (Closes: #415471)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
    Copyright (C) 2002  PowerDNS.COM BV
4
4
 
5
5
    This program is free software; you can redistribute it and/or modify
6
 
    it under the terms of the GNU General Public License as published by
7
 
    the Free Software Foundation; either version 2 of the License, or
8
 
    (at your option) any later version.
 
6
    it under the terms of the GNU General Public License version 2
 
7
    as published by the Free Software Foundation
 
8
    
9
9
 
10
10
    This program is distributed in the hope that it will be useful,
11
11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 
15
15
    You should have received a copy of the GNU General Public License
16
16
    along with this program; if not, write to the Free Software
17
 
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
18
*/
19
19
#include "utility.hh"
20
20
#include "session.hh"
135
135
  if((err=connect(clisock,(struct sockaddr*)&remote,sizeof(remote)))<0 && WSAGetLastError() != WSAEWOULDBLOCK ) {
136
136
#endif // WIN32
137
137
    throw SessionException("connect: "+stringerror());
138
 
 
139
138
  }
140
139
 
141
140
  if(!err)
395
394
  s=socket(AF_INET,SOCK_STREAM,0);
396
395
 
397
396
  if(s<0)
398
 
    {
399
 
      throw Exception(string("socket: ")+strerror(errno));
400
 
    }
 
397
    throw Exception(string("socket: ")+strerror(errno));
401
398
  
402
399
  memset(&local,0,sizeof(local));
403
400
  
427
424
  if(setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char*)&tmp,sizeof tmp)<0)
428
425
    throw SessionException(string("Setsockopt failed: ")+strerror(errno));
429
426
 
430
 
 
431
427
  if(bind(s, (sockaddr*)&local,sizeof(local))<0)
432
 
      throw SessionException("binding to port "+itoa(port)+string(": ")+strerror(errno));
 
428
      throw SessionException("binding to port "+itoa(port)+string(" on ")+localaddress+": "+strerror(errno));
433
429
  
434
430
  if(listen(s,128)<0)
435
431
      throw SessionException("listen: "+stringerror());