whatsnew-14.txt 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. What's New In Libevent 1.4:
  2. 0. About this document
  3. This document describes the key differences between Libevent 1.3 and
  4. Libevent 1.4, from a user's point of view. It was most recently
  5. updated based on features from libevent 1.4.2-rc.
  6. 1. Packaging Issues.
  7. 1.1. The great library division.
  8. The libevent source now builds two libraries: libevent_core and
  9. libevent_extra. The libevent_core library includes event loops,
  10. timers, buffer code, and various small compatibility functions. The
  11. libevent_extra library includes code for HTTP, DNS, RPC, and so on.
  12. Thus, if you're writing software that only uses libevent's event
  13. loop, you should link against only the libevent_core library,
  14. whereas if you're writing software that uses libevent's protocol
  15. support as well, you need to link libevent_extra as well.
  16. For backward compatibility, libevent also builds a library called
  17. "libevent" that includes everything.
  18. 1.2. The event-config.h header
  19. Libevent configure script now builds two headers from its configure
  20. script: config.h (which it uses internally) and event-config.h
  21. (which it installs as a header file). All of the macros in
  22. event-config.h are modified so that they're safe to include in other
  23. projects. This allows libevent's header files (like event.h and
  24. evutil.h) information about platform configuration.
  25. What does this mean for you? As of 1.4.x, it should never be
  26. necessary to include extra files or define extra types before you
  27. include event.h (or any other libevent header); event.h can now look
  28. at the information in event-config.h and figure out what it needs to
  29. include.
  30. 1.3. Documentation
  31. Libevent now includes better doxygen documentation. It's not
  32. perfect or complete, though; if you find a mistake, please let us
  33. know.
  34. 1.4. Libtool usage
  35. We now use libtool's library versioning support correctly. If we
  36. don't mess this up, it means that binaries linked against old
  37. version of libevent should continue working when we make changes to
  38. libevent that don't break backward compatibility.
  39. 1.5. Portability
  40. Libevent now builds with MSVC again. We've only tested it with MSVC
  41. 2005, and the project files might not be right. Please let us know
  42. if you run into any issues.
  43. Libevent now builds on platforms where /bin/sh is not bash.
  44. Libevent's regression test no longer requires Python to be
  45. installed.
  46. 2. New and Improved APIs:
  47. (This list includes functions that are new, functions whose behavior
  48. has changed, and functions that were included in previous releases
  49. but which never actually worked before.)
  50. 2.1. Utility functions are defined in evutil.h
  51. Libevent now exposes a small set of functions for cross-platform
  52. network programming in evutil.h, on the theory that they've been
  53. useful enough to us that other people may likely want to use them
  54. too. These are mainly workarounds for Windows issues for now: they
  55. include evutil_socketpair (to fake socketpair on platforms that
  56. don't have it) and evutil_make_socket_nonblocking (to make a socket
  57. nonblocking in a cross-platform way. See the header for more
  58. information.
  59. 2.2. In the libevent core.
  60. The event_base_free() function now works. Previously, it would
  61. crash with an assertion failure if there were events pending on a
  62. base. Now, it simply deletes all the pending events and frees the
  63. base. Be careful -- this might leak fds and memory associated with
  64. the old events. To avoid leaks, you should still remove all the
  65. events and free their resources before you delete the base.
  66. Libevent should now work properly with fork(). Just call
  67. event_reinit() on your event base after the fork call, and it should
  68. work okay. Please let us know about any bugs you find.
  69. There's a new event_base_new() function that acts just like
  70. event_init(), but does not replace the default base. If you are
  71. using multiple event bases in your code, you should just use
  72. event_base_new() instead of event_init(), to avoid accidental bugs.
  73. There's new event_loopbreak() function to make a current event loop
  74. stop exiting and return. Unlike event_loopexit, it stops subsequent
  75. pending events from getting executed. This behavior is useful for
  76. scripting languages to implement exceptions from inside callbacks.
  77. There's a new event_base_get_method() function, for use in place of
  78. event_get_method() in multi-base applications.
  79. 2.3. New in HTTP.
  80. There's an evhttp_connection_set_local_address() function you can
  81. use to set the local address of an HTTP connection.
  82. HTTP/1.1 chunking now correctly ends chunks with '\r\n'.
  83. 2.4. New in DNS
  84. Instead of picking your method for generating DNS transaction IDs at
  85. startup, you can use evdns_set_transaction_id() to provide a
  86. transaction ID function at runtime.
  87. The "class" field in evdns_server_request is now renamed to
  88. dns_question_class, so that it won't break compilation under C++.
  89. This uses some preprocessor hacks so that C code using the old name
  90. won't break. Eventually, the old name will be deprecated entirely;
  91. please don't use it.
  92. 2.5. New in RPC
  93. There are now hooks on RPC input and output; can be used to
  94. implement RPC independent processing such as compression or
  95. authentication.
  96. RPC tags can now be up to 32 bits. This is wire-compatible, but
  97. changes some of the types in the APIs. Please let us know if this
  98. is problematic for you.
  99. 3. Big bugfixes
  100. We've done a lot, with help from users on different platforms, to
  101. make the different backends behave more similarly with respect to
  102. signals and timeouts. The kqueue and solaris backends were the big
  103. offenders previously, but they should be better now. Windows should
  104. be better too, though it's likely that problems remain there.
  105. The libevent headers (though not the source files!) should now build
  106. cleanly on C++.
  107. (For more bugfixes, see the ChangeLog file. These are only the
  108. biggies.)
  109. 4. Big performance improvements
  110. Libevent now uses a min-heap rather than a red-black tree to track
  111. timeouts. This means that finding the next timeout to fire is now
  112. O(1) instead of (lg n).
  113. The win32 select-based backend now uses a red-black tree to map
  114. SOCKET handles to event structures. This changes the performance
  115. characteristics of the event loop on win32 from O(n^2) to O(n lg n).
  116. Not perfect, but better.
  117. 5. Removed code and features
  118. The rtsig backend is now removed. It hasn't even compiled for a
  119. while, and nobody seemed to miss it very much. All the platforms
  120. that have rtsig seem to have a better option instead these days.
  121. Please let us know if rtsig was crucial for you.