mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-11 21:34:53 -04:00
Merge remote-tracking branch 'origin/patches-2.0'
This commit is contained in:
commit
2bbed8fe2a
@ -158,7 +158,7 @@ be_pair_transfer(struct bufferevent *src, struct bufferevent *dst,
|
||||
evbuffer_unfreeze(dst->input, 0);
|
||||
|
||||
if (dst->wm_read.high) {
|
||||
size_t dst_size = evbuffer_get_length(dst->input);
|
||||
dst_size = evbuffer_get_length(dst->input);
|
||||
if (dst_size < dst->wm_read.high) {
|
||||
n = dst->wm_read.high - dst_size;
|
||||
evbuffer_remove_buffer(src->output, dst->input, n);
|
||||
|
@ -315,10 +315,12 @@ struct event_config {
|
||||
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
||||
#endif
|
||||
|
||||
#ifndef TAILQ_FOREACH
|
||||
#define TAILQ_FOREACH(var, head, field) \
|
||||
for ((var) = TAILQ_FIRST(head); \
|
||||
(var) != TAILQ_END(head); \
|
||||
(var) = TAILQ_NEXT(var, field))
|
||||
#endif
|
||||
|
||||
#ifndef TAILQ_INSERT_BEFORE
|
||||
#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
|
||||
|
6
evutil.c
6
evutil.c
@ -54,15 +54,15 @@
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#ifdef _EVENT_HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
#ifdef _EVENT_HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
#ifdef _EVENT_HAVE_NETINET_IN6_H
|
||||
#include <netinet/in6.h>
|
||||
#endif
|
||||
#ifdef _EVENT_HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#ifndef _EVENT_HAVE_GETTIMEOFDAY
|
||||
#include <sys/timeb.h>
|
||||
|
@ -223,7 +223,6 @@ ht_string_hash(const char *s)
|
||||
void *data) \
|
||||
{ \
|
||||
unsigned idx; \
|
||||
int remove; \
|
||||
struct type **p, **nextp, *next; \
|
||||
if (!head->hth_table) \
|
||||
return; \
|
||||
@ -232,8 +231,7 @@ ht_string_hash(const char *s)
|
||||
while (*p) { \
|
||||
nextp = &(*p)->field.hte_next; \
|
||||
next = *nextp; \
|
||||
remove = fn(*p, data); \
|
||||
if (remove) { \
|
||||
if (fn(*p, data)) { \
|
||||
--head->hth_n_entries; \
|
||||
*p = next; \
|
||||
} else { \
|
||||
|
Loading…
x
Reference in New Issue
Block a user