[svn] commit: r1074 - in /trunk/src/bin/auth: auth_srv.cc auth_srv.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Mar 2 18:54:10 UTC 2010
Author: jinmei
Date: Tue Mar 2 18:54:10 2010
New Revision: 1074
Log:
cleanup
Modified:
trunk/src/bin/auth/auth_srv.cc
trunk/src/bin/auth/auth_srv.h
Modified: trunk/src/bin/auth/auth_srv.cc
==============================================================================
--- trunk/src/bin/auth/auth_srv.cc (original)
+++ trunk/src/bin/auth/auth_srv.cc Tue Mar 2 18:54:10 2010
@@ -21,8 +21,6 @@
#include <netdb.h>
#include <stdlib.h>
-#include <algorithm>
-#include <set>
#include <iostream>
#include <dns/buffer.h>
@@ -40,7 +38,6 @@
#include "auth_srv.h"
#include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
using namespace std;
@@ -50,10 +47,12 @@
using namespace isc::data;
using namespace isc::config;
-AuthSrv::AuthSrv(int port) {
+AuthSrv::AuthSrv(int port)
+{
int s = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
- if (s < 0)
+ if (s < 0) {
throw FatalError("failed to open socket");
+ }
struct sockaddr_in sin;
sin.sin_family = AF_INET;
@@ -65,8 +64,9 @@
sin.sin_len = sa_len;
#endif
- if (bind(s, (struct sockaddr *)&sin, sa_len) < 0)
+ if (bind(s, (struct sockaddr *)&sin, sa_len) < 0) {
throw FatalError("could not bind socket");
+ }
sock = s;
@@ -80,7 +80,8 @@
}
void
-AuthSrv::processMessage() {
+AuthSrv::processMessage()
+{
struct sockaddr_storage ss;
socklen_t sa_len = sizeof(ss);
struct sockaddr* sa = static_cast<struct sockaddr*>((void*)&ss);
@@ -115,8 +116,7 @@
msg.setUDPSize(sizeof(recvbuf));
// do the DataSource call here
- Query q = Query(msg, false);
- data_src.doQuery(q);
+ data_src.doQuery(Query(msg, false));
OutputBuffer obuffer(remote_bufsize);
MessageRenderer renderer(obuffer);
@@ -136,7 +136,8 @@
}
ElementPtr
-AuthSrv::updateConfig(isc::data::ElementPtr new_config) {
+AuthSrv::updateConfig(isc::data::ElementPtr new_config)
+{
if (new_config) {
// the ModuleCCSession has already checked if we have
// the correct ElementPtr type as specified in our .spec file
Modified: trunk/src/bin/auth/auth_srv.h
==============================================================================
--- trunk/src/bin/auth/auth_srv.h (original)
+++ trunk/src/bin/auth/auth_srv.h Tue Mar 2 18:54:10 2010
@@ -17,6 +17,8 @@
#ifndef __AUTH_SRV_H
#define __AUTH_SRV_H 1
+#include <string>
+
#include <cc/data.h>
#include <auth/data_source_static.h>
#include <auth/data_source_sqlite3.h>
@@ -31,10 +33,13 @@
isc::data::ElementPtr updateConfig(isc::data::ElementPtr config);
private:
std::string _db_file;
-
+
isc::auth::MetaDataSrc data_src;
int sock;
};
#endif // __AUTH_SRV_H
+// Local Variables:
+// mode: c++
+// End:
More information about the bind10-changes
mailing list