Browse Source

[Fix] Do not pollute public headers with libev internals

pull/4600/head
Vsevolod Stakhov 2 years ago
parent
commit
ac2ee05594
No known key found for this signature in database GPG Key ID: 7647B6790081437
  1. 1
      src/libserver/dns.c
  2. 9
      src/libserver/dns.h
  3. 7
      src/libutil/upstream.c
  4. 19
      src/libutil/upstream.h
  5. 1
      src/libutil/util.c
  6. 17
      src/libutil/util.h

1
src/libserver/dns.c

@ -20,6 +20,7 @@
#include "dns.h"
#include "rspamd.h"
#include "utlist.h"
#include "contrib/libev/ev.h"
#include "contrib/librdns/rdns.h"
#include "contrib/librdns/dns_private.h"
#include "contrib/librdns/rdns_ev.h"

9
src/libserver/dns.h

@ -1,11 +1,11 @@
/*-
* Copyright 2016 Vsevolod Stakhov
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -31,13 +31,14 @@ extern "C" {
struct rspamd_config;
struct rspamd_task;
struct event_loop;
struct rspamd_dns_resolver {
struct rdns_resolver *r;
struct ev_loop *event_loop;
rspamd_lru_hash_t *fails_cache;
void *uidna;
ev_tstamp fails_cache_time;
double fails_cache_time;
struct upstream_list *ups;
struct rspamd_config *cfg;
gdouble request_timeout;

7
src/libutil/upstream.c

@ -1,11 +1,11 @@
/*-
* Copyright 2016 Vsevolod Stakhov
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ -21,6 +21,7 @@
#include "rdns.h"
#include "cryptobox.h"
#include "utlist.h"
#include "contrib/libev/ev.h"
#include "logger.h"
#include "contrib/librdns/rdns.h"
#include "contrib/mumhash/mum.h"

19
src/libutil/upstream.h

@ -1,3 +1,19 @@
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef UPSTREAM_H
#define UPSTREAM_H
@ -10,6 +26,9 @@
extern "C" {
#endif
/* Forward declaration */
struct ev_loop;
enum rspamd_upstream_rotation {
RSPAMD_UPSTREAM_RANDOM = 0,
RSPAMD_UPSTREAM_HASHED,

1
src/libutil/util.c

@ -19,6 +19,7 @@
#include "ottery.h"
#include "cryptobox.h"
#include "contrib/libev/ev.h"
#ifdef HAVE_TERMIOS_H
#include <termios.h>

17
src/libutil/util.h

@ -1,3 +1,19 @@
/*
* Copyright 2023 Vsevolod Stakhov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef RSPAMD_UTIL_H
#define RSPAMD_UTIL_H
@ -12,7 +28,6 @@
#include <netdb.h>
#endif
#include "contrib/libev/ev.h"
#include <time.h>
#ifdef __cplusplus

Loading…
Cancel
Save