From 3e369548c13b63feddcff5867903055b73fae217 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 2 Mar 2010 11:55:50 +0000 Subject: Make ready for 1.2.0 release. --- server/configure.in | 2 +- server/src/Makefile.am | 3 +++ server/src/tcpsocket.cc | 34 ++++++++++++++++++++++------------ server/xml/macros/test_metawidget.xml | 4 +++- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/server/configure.in b/server/configure.in index 835f109..b6beada 100644 --- a/server/configure.in +++ b/server/configure.in @@ -1,7 +1,7 @@ # Filename: configure.in AC_INIT(src/pracrod.cc) -AM_INIT_AUTOMAKE( pracrod, 1.1.0 ) +AM_INIT_AUTOMAKE( pracrod, 1.2.0 ) dnl ====================== dnl Compile with debug options diff --git a/server/src/Makefile.am b/server/src/Makefile.am index f269db8..98a154e 100644 --- a/server/src/Makefile.am +++ b/server/src/Makefile.am @@ -94,12 +94,15 @@ EXTRA_DIST = \ pracrodao.h \ pracrodaopgsql.h \ pracrodaotest.h \ + queryresult.h \ resumeparser.h \ saxparser.h \ server.h \ + template.h \ templatelist.h \ templateheaderparser.h \ templateparser.h \ + transaction.h \ transactionparser.h \ tcpsocket.h \ utf8.h \ diff --git a/server/src/tcpsocket.cc b/server/src/tcpsocket.cc index f748e0a..818934e 100644 --- a/server/src/tcpsocket.cc +++ b/server/src/tcpsocket.cc @@ -90,12 +90,14 @@ TCPSocket::TCPSocket(std::string name, int sock) isconnected = false; this->sock = sock; - PRACRO_DEBUG(socket, "TCPSocket %s: %p %d (%d)\n", name.c_str(), this, sock, getpid()); + PRACRO_DEBUG(socket, "TCPSocket %s: %p %d (%d)\n", name.c_str(), + this, sock, getpid()); } TCPSocket::~TCPSocket() { - PRACRO_DEBUG(socket, "~TCPSocket %s: %p %d (%d)\n", name.c_str(), this, sock, getpid()); + PRACRO_DEBUG(socket, "~TCPSocket %s: %p %d (%d)\n", name.c_str(), + this, sock, getpid()); disconnect(); } @@ -109,7 +111,7 @@ void TCPSocket::listen(unsigned short int port) if(isconnected) throw TCPListenException("Socket alread connected."); struct sockaddr_in socketaddr; - memset((char *) &socketaddr, sizeof(socketaddr), 0); + memset((char *) &socketaddr, 0, sizeof(socketaddr)); socketaddr.sin_family = AF_INET; socketaddr.sin_port = htons(port); socketaddr.sin_addr.s_addr = htonl(INADDR_ANY); @@ -159,27 +161,32 @@ TCPSocket *TCPSocket::accept() } } if(FD_ISSET(sock, &fset)) { - int csock = _accept(sock, (struct sockaddr*)&ssocketaddr, (socklen_t*)&csalen); + int csock = _accept(sock, (struct sockaddr*)&ssocketaddr, + (socklen_t*)&csalen); TCPSocket *child = new TCPSocket(name + "-child", csock); if (child->sock == -1) { - throw TCPAcceptException(std::string("accept failed - ") + strerror(errno)); + throw TCPAcceptException(std::string("accept failed - ") + + strerror(errno)); } child->isconnected = true; return child; } else { - PRACRO_ERR_LOG(socket, "Accept returned with no socket - This should not happen!\n"); + PRACRO_ERR_LOG(socket, "Accept returned with no socket" + " - This should not happen!\n"); return NULL; } } -static int _connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen) +static int _connect(int sockfd, const struct sockaddr *serv_addr, + socklen_t addrlen) {return connect(sockfd, serv_addr, addrlen);} void TCPSocket::connect(std::string addr, unsigned short int port) throw(TCPConnectException) { - if(isconnected) throw TCPConnectException("Socket already connected.", "", ""); + if(isconnected) + throw TCPConnectException("Socket already connected.", "", ""); #ifndef BYPASS_STATICALLOCATIONS // Do DNS lookup @@ -191,7 +198,8 @@ void TCPSocket::connect(std::string addr, unsigned short int port) char portno[32]; sprintf(portno, "%d", port); throw TCPConnectException(addr, portno, - std::string("host lookup failed: ") + hstrerror(h_errno)); + std::string("host lookup failed: ") + + hstrerror(h_errno)); } addr_list = (struct in_addr **)he->h_addr_list; @@ -202,7 +210,7 @@ void TCPSocket::connect(std::string addr, unsigned short int port) #endif/*BYPASS_STATICALLOCATIONS*/ struct sockaddr_in socketaddr; - memset((char *) &socketaddr, sizeof(socketaddr), 0); + memset((char *) &socketaddr, 0, sizeof(socketaddr)); socketaddr.sin_family = AF_INET; socketaddr.sin_port = htons(port); socketaddr.sin_addr.s_addr = inet_addr(ip); @@ -219,7 +227,8 @@ void TCPSocket::connect(std::string addr, unsigned short int port) void TCPSocket::disconnect() { if(sock != -1) { - PRACRO_DEBUG(socket, "Closing TCPSocket %s: %p %d (%d)\n", name.c_str(), this, sock, getpid()); + PRACRO_DEBUG(socket, "Closing TCPSocket %s: %p %d (%d)\n", + name.c_str(), this, sock, getpid()); int ret = close(sock); if(ret == -1) { perror(name.c_str()); @@ -296,7 +305,8 @@ int TCPSocket::read(char *buf, int size, long timeout) return res; } -ssize_t _write(int fd, const void *buf, size_t count) { return write(fd, buf, count); } +ssize_t _write(int fd, const void *buf, size_t count) +{ return write(fd, buf, count); } int TCPSocket::write(char *data, int size) throw(TCPWriteException) { diff --git a/server/xml/macros/test_metawidget.xml b/server/xml/macros/test_metawidget.xml index a2d51ea..0e66ce5 100644 --- a/server/xml/macros/test_metawidget.xml +++ b/server/xml/macros/test_metawidget.xml @@ -10,8 +10,10 @@ +