~ubuntu-branches/ubuntu/oneiric/syslog-ng/oneiric

« back to all changes in this revision

Viewing changes to tests/unit/test_logqueue.c

  • Committer: Bazaar Package Importer
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2011-05-16 22:02:46 UTC
  • mfrom: (26.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20110516220246-nknmeu831n49bx1z
Tags: 3.2.4-1
* New upstream release, fixing infinite loop via PCRE and global. No CVE
  number yet, Vigil@nce id is 10648.
* Remove all patches, they were applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#include "logqueue.h"
2
2
#include "logpipe.h"
3
3
#include "apphook.h"
 
4
#include "plugin.h"
4
5
 
5
6
#include <stdlib.h>
6
7
#include <string.h>
7
8
 
8
9
int acked_messages = 0;
9
10
int fed_messages = 0;
 
11
MsgFormatOptions parse_options;
10
12
 
11
13
#define OVERFLOW_SIZE 10000
12
14
 
28
30
    {
29
31
      char *msg_str = "<155>2006-02-11T10:34:56+01:00 bzorp syslog-ng[23323]: árvíztűrőtükörfúrógép";
30
32
 
31
 
      msg = log_msg_new(msg_str, strlen(msg_str), g_sockaddr_inet_new("10.10.10.10", 1010), 0, NULL, -1, 0xFFFF);
 
33
      msg = log_msg_new(msg_str, strlen(msg_str), g_sockaddr_inet_new("10.10.10.10", 1010), &parse_options);
32
34
      log_msg_add_ack(msg, &path_options);
33
35
      msg->ack_func = test_ack;
34
36
      if (!log_queue_push_tail((*q), msg, &path_options))
134
136
 
135
137
  for (i = 0; i < 100000; i++)
136
138
    {
137
 
      msg = log_msg_new(msg_str, strlen(msg_str), g_sockaddr_inet_new("10.10.10.10", 1010), 0, NULL, -1);
 
139
      msg = log_msg_new(msg_str, strlen(msg_str), g_sockaddr_inet_new("10.10.10.10", 1010), &parse_options);
138
140
      log_msg_add_ack(msg, &path_options);
139
141
      msg->ack_func = test_ack;
140
142
 
207
209
  putenv("TZ=MET-1METDST");
208
210
  tzset();
209
211
 
 
212
  configuration = cfg_new(0x0302);
 
213
  plugin_load_module("syslogformat", configuration, NULL);
 
214
  msg_format_options_defaults(&parse_options);
 
215
  msg_format_options_init(&parse_options, configuration);
 
216
 
210
217
  testcase_zero_diskbuf_alternating_send_acks();
211
218
  testcase_zero_diskbuf_and_normal_acks();
212
219
  return 0;