~ubuntu-branches/ubuntu/trusty/dansguardian/trusty

« back to all changes in this revision

Viewing changes to src/contentscanners/kavdscan.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Wirt, Thomas Viehmann
  • Date: 2008-10-13 09:29:35 UTC
  • mfrom: (1.1.7 upstream) (7.1.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081013092935-g8uz3kgfjs37ikgv
Tags: 2.9.9.7-2
[ Thomas Viehmann ]
OptionContainer.cpp: If you need to iterate through all lines in the
config file to find a field, at least don't abuse the configfile deque
by accessing it as if it was an array with signed index.
Works way better on arm, too, i.e. closes: #493047.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
 
23
23
// INCLUDES
 
24
#ifdef HAVE_CONFIG_H
 
25
        #include "dgconfig.h"
 
26
#endif
24
27
 
25
28
#include "../ContentScanner.hpp"
26
29
#include "../UDSocket.hpp"
137
140
        try {
138
141
                // read kaspersky kavdscan (AV Enging Server) - format: 2xx greeting
139
142
                rc = stripedsocks.getLine(buff, 4096, o.content_scanner_timeout);
140
 
        } catch(exception & e) {
 
143
        } catch(std::exception & e) {
141
144
        }
142
145
        if (buff[0] != '2') {
143
146
                delete[]buff;
148
151
        try {
149
152
                stripedsocks.writeString(command.toCharArray());
150
153
        }
151
 
        catch(exception & e) {
 
154
        catch(std::exception & e) {
152
155
                delete[]buff;
153
156
                stripedsocks.close();
154
157
                syslog(LOG_ERR, "%s", "unable to write to kavdscan");
157
160
        try {
158
161
                rc = stripedsocks.getLine(buff, 4096, o.content_scanner_timeout);
159
162
        }
160
 
        catch(exception & e) {
 
163
        catch(std::exception & e) {
161
164
                delete[]buff;
162
165
                stripedsocks.close();
163
166
                syslog(LOG_ERR, "%s", "Error reading kavdscan socket");
184
187
                        try {
185
188
                                rc = stripedsocks.getLine(buff, 4096, o.content_scanner_timeout);
186
189
                        }
187
 
                        catch(exception & e) {
 
190
                        catch(std::exception & e) {
188
191
                                delete[]buff;
189
192
                                stripedsocks.close();
190
193
                                syslog(LOG_ERR, "%s", "Error reading kavdscan socket");