25 November 2020: Wouter
- with udp-connect ignore connection refused with UDP timeouts.
- Fix udp-connect on FreeBSD, do send calls on connected UDP socket.
+ - Better fix for reuse tree comparison for is-tls sockets. Where
+ the tree key identity is preserved after cleanup of the TLS state.
24 November 2020: Wouter
- Merge PR #283 : Stream reuse. This implements upstream stream
return r;
/* compare if SSL-enabled */
- if(r1->pending->c->ssl && !r2->pending->c->ssl)
+ if(r1->is_ssl && !r2->is_ssl)
return 1;
- if(!r1->pending->c->ssl && r2->pending->c->ssl)
+ if(!r1->is_ssl && r2->is_ssl)
return -1;
return 0;
}
key_p.c = &c;
key_p.reuse.pending = &key_p;
key_p.reuse.node.key = &key_p.reuse;
- if(use_ssl) /* something nonNULL for comparisons in tree */
- key_p.c->ssl = (void*)1;
+ if(use_ssl)
+ key_p.reuse.is_ssl = 1;
if(addrlen > sizeof(key_p.reuse.addr))
return NULL;
memmove(&key_p.reuse.addr, addr, addrlen);
pend->c->repinfo.addrlen = w->addrlen;
memcpy(&pend->c->repinfo.addr, &w->addr, w->addrlen);
pend->reuse.pending = pend;
+ if(pend->c->ssl)
+ pend->reuse.is_ssl = 1;
+ else pend->reuse.is_ssl = 0;
/* insert in reuse by address tree if not already inserted there */
(void)reuse_tcp_insert(w->outnet, pend);
reuse_tree_by_id_insert(&pend->reuse, w);
struct sockaddr_storage addr;
/** length of addr */
socklen_t addrlen;
+ /** also key for tcp_reuse tree, if ssl is used */
+ int is_ssl;
/** lru chain, so that the oldest can be removed to get a new
* connection when all are in (re)use. oldest is last in list.
* The lru only contains empty connections waiting for reuse,