Skip to content

Libevent 2.0.4-alpha released

Libevent 2.0.4-alpha is now available for download:

The complete change list is available here.

Some of the feature improvements include:
  • bufferevents can now be rate limited
  • http connections can now resolve host names asynchronously
  • a facility for lock debugging
  • arc4random() for evdns

However, we (that means mostly Nick) have also made a large number of bug fixes and stability improvements across many platforms. Many thanks to everyone who helped by providing bug reports and patches including Brodie Thiesfield, Dagobert Michelsen, Evan Jones, Joachim Bauch, Pavel Plesov, Roman Puls, Sebastian Hahn, William Ahern, Yasuoka Masahiko and Zhuang Yuyao.

In a separate email, Nick also provided a much more verbose description of what all changed.
Categories: Libevent, News
Defined tags for this entry: ,

Cable Tantos

Cable TantoAlthough, I have made various attempts at forging knives, this tanto is the first knife I have completed. It's a shinogi-zukuri tanto with choji hamon. The steel was made from forge-welded high carbon cable. Originally, this was supposed to become a wakizashi, but due to a bad hammer blow when forging the sunobe, I had to fold it over and no longer had enough steel for a longer blade. As a result, the blade is only about 9in long. The habaki was made from brazed copper and the shira-saya was carved from a popular blank.

Cable TantosThe picture to the left shows two more cable tantos in various stages of progress. The top one had some rough grinding done to it whereas the bottom one is straight from the forge. Only about 10% of the time is actually spent forging the blades. The rest of time is spent grinding, polishing and working on the habaki as well as on the saya and everything else.

Categories: Hacking
Defined tags for this entry: , , ,

OpenSSL Client Certificates and Libevent-2.0.3-alpha

Tom Pusateri reported success with using OpenSSL client certificates and libevent's builtin OpenSSL support. Here is what he wrote on the mailing list:

I tried 2.0.3 alpha against the Apple Push notification feedback service which requires a client key/certificate and it works great.

One hint... Make sure you add the key and cert to the SSL context before calling SSL_new(). Otherwise, you'll get an error that looks like:
sslv3 alert handshake failure in SSL routines SSL3_READ_BYTES
Here's the working code:

static void
init_feedback_service(struct event_base *ev_base,
    struct evdns_base *dns)
   int rc;
   struct bufferevent *bev;
   SSL_CTX *ssl_ctx;
   SSL *ssl;

   ssl_ctx = SSL_CTX_new(SSLv3_method());

   rc = SSL_CTX_use_certificate_file(ssl_ctx, "my_apple_cert_key.pem",
   if (rc != 1) {
       errx(EXIT_FAILURE, "Could not load certificate file");
   rc = SSL_CTX_use_PrivateKey_file(ssl_ctx, "my_apple_cert_key.pem",
   if (rc != 1) {
       errx(EXIT_FAILURE, "Could not load private key file");

   ssl = SSL_new(ssl_ctx);
   bev = bufferevent_openssl_socket_new(ev_base, -1, ssl,
   bufferevent_setcb(bev, feedback_read_cb, NULL,
       feedback_event_cb, NULL);
   rc = bufferevent_socket_connect_hostname(bev, dns, AF_INET,
       "", 2196);
   if (rc < 0) {
       warnx("could not connect to feedback service: %s",
   bufferevent_enable(bev, EV_READ);
Categories: Libevent
Defined tags for this entry:

Libevent-2.0.3-alpha release

It has been a while since the last alpha release of libevent-2.0. Yesterday, we released 2.0.3-alpha which can be downloaded from

Please, give it a spin and let us know if you run into any problems. There have been a lot of changes since the last release, mostly due to Nick's hard work. Here are just some highlights, the ChangeLog contains the full story:

- SSL/TLS support on bufferevents, using the OpenSSL library
- Improved searching on evbuffer objects
- Improved support for Windows
- More efficient memory allocation for event_bases that use epoll
- Improved thread-safety
- The IOCP bufferevent backend is now exposed on Windows; many thanks to Christopher Davis for his work.

Many thanks to everyone who helped with patches and bug reports including Rocco Carbone, Brodie Thiesfield, Caitlin Mercer, David Reiss, Alexander Pronchenkov, Jacek Masiulaniec, Ka-Hing Cheung, Christopher Davis, Ferenc Szalai, and Ryan Phillips.

Edited to fix the link.
Categories: Libevent, News
Defined tags for this entry: ,

Libevent 1.4.13-stable released

We just released a new stable version of Libevent that fixes the following problems:
  • If the kernel tells us that there are a negative number of bytes to read from a socket, do not believe it. Fixes bug 2841177; found by Alexander Pronchenkov.
  • Do not allocate the maximum event queue and fd array for the epoll backend at startup. Instead, start out accepting 32 events at a time, and double the queue's size when it seems that the OS is generating events faster than we're requesting them. Saves up to 512K per epoll-based event_base. Resolves bug 2839240.
  • Fix compilation on Android, which forgot to define fd_mask in its sys/select.h
  • Do not drop data from evbuffer when out of memory; reported by Jacek Masiulaniec
  • Rename our replacement compat/sys/_time.h header to avoid build a conflict on HPUX; reported by Kathryn Hogg.
  • Build kqueue.c correctly on GNU/kFreeBSD platforms. Patch pulled upstream from Debian.
  • Fix a problem with excessive memory allocation when using multiple event priorities.
  • When running set[ug]id, don't check the environment. Based on a patch from OpenBSD.

A new alpha release of libevent 2.0 is on its way, too. Thanks to everyone who submitted patches and bug reports.

The source code is available at Don't forget to verify the signature.
Categories: Libevent, News
Defined tags for this entry: ,

San Mai Knife

Failed San Mai Attempt A while ago, I forged a San Mai billet with the hope to turn it into a tanto. Unfortunately, the forge I was using had a very oxygen rich atmosphere and the welds did not take very well. Over the last couple of days, I spent some time grinding and heat treating the remaining steel into a knife for practice purposes. The cable structure of the knife came out very nicely with repeated applications of lemon juice and metal polish to remove the oxides left by the lemon juice etch.

I also figured out how to take decent pictures of the steel. The trick was to use direct light rather than diffused light that shines directly on the blade, and then have black surfaces inside the light box. The angle of the knife needs to be so that the black is reflected do the camera. Although, this is a failed knife due to all the welding flaws, it still was an interesting experiment.
Categories: Hacking
Defined tags for this entry: ,