if (chain->buffer_len >= need)
goto ok;
- /* If the misalignment plus the remaining space fulfils our
+ /* If the misalignment plus the remaining space fulfills our
* data needs, we just force an alignment to happen.
* Afterwards, we have enough space.
*/
* reading. We do not want to exhaust resources
* before the reader has a chance to do something
* about it. If the reader does not tell us how much
- * data we should read, we artifically limit it.
+ * data we should read, we artificially limit it.
*/
if (chain == NULL || n < EVBUFFER_MAX_READ)
n = EVBUFFER_MAX_READ;
/* TODO(niels): implement splice */
res = sendfile(fd, info->fd, &offset, chain->off);
if (res == -1 && EVUTIL_ERR_RW_RETRIABLE(errno)) {
- /* if this is EGAIN or EINTR return 0; otherwise, -1 */
+ /* if this is EAGAIN or EINTR return 0; otherwise, -1 */
return (0);
}
return (res);
/* TODO(niels): maybe we don't want to own the fd, however, in that
* case, we should dup it - dup is cheap. Perhaps, we should use a
- * callback insead?
+ * callback instead?
*/
/* TODO(niels): we may want to add to automagically convert to mmap, in
* case evbuffer_remove() or evbuffer_pullup() are being used.
* ========= */
/** Internal use: Set up the ev_read and ev_write callbacks so that
* the other "generic_timeout" functions will work on it. Call this from
- * the constuctor function. */
+ * the constructor function. */
void _bufferevent_init_generic_timeout_cbs(struct bufferevent *bev);
/** Internal use: Delete the ev_read and ev_write callbacks if they're pending.
- * Call thiss from the destructor function. */
+ * Call this from the destructor function. */
void _bufferevent_del_generic_timeout_cbs(struct bufferevent *bev);
/** Internal use: Add or delete the generic timeout events as appropriate.
* (If an event is enabled and a timeout is set, we add the event. Otherwise
void _bufferevent_generic_adj_timeouts(struct bufferevent *bev);
/** Internal use: We have just successfully read data into an inbuf, so
- * reset the read timout (if any). */
+ * reset the read timeout (if any). */
#define BEV_RESET_GENERIC_READ_TIMEOUT(bev) \
do { \
if (evutil_timerisset(&(bev)->timeout_read)) \
event_add(&(bev)->ev_read, &(bev)->timeout_read); \
} while (0)
/** Internal use: We have just successfully written data from an inbuf, so
- * reset the read timout (if any). */
+ * reset the read timeout (if any). */
#define BEV_RESET_GENERIC_WRITE_TIMEOUT(bev) \
do { \
if (evutil_timerisset(&(bev)->timeout_write)) \
struct bufferevent_filtered {
struct bufferevent_private bev;
- /** The bufferevent that we read/write filterd data from/to. */
+ /** The bufferevent that we read/write filtered data from/to. */
struct bufferevent *underlying;
/** A callback on our outbuf to notice when somebody adds data */
struct evbuffer_cb_entry *outbuf_cb;
Here we define a BIO implementation that directs its output to a
bufferevent. We'll want to use this only when none of OpenSSL's built-in
- IO mechinsms work for us.
+ IO mechanisms work for us.
-------------------- */
/* every BIO type needs its own integer type value. */
}
/* --------------------
- Now, here's the openssl-based implementation of bufferevent.
+ Now, here's the OpenSSL-based implementation of bufferevent.
The implementation comes in two flavors: one that connects its SSL object
to an underlying bufferevent using a BIO_bufferevent, and one that has the
-------------------- */
struct bufferevent_openssl {
- /* Shared fields with common bufferevet implementation code.
+ /* Shared fields with common bufferevent implementation code.
If we were set up with an underlying bufferevent, we use the
events here as timers only. If we have an SSL, then we use
the events as socket events.
};
/* Given a bufferevent, return a pointer to the bufferevent_openssl that
- * countains it, if any. */
+ * contains it, if any. */
static inline struct bufferevent_openssl *
upcast(struct bufferevent *bev)
{
BEV_UNLOCK(bufev);
}
-/* XXXX Should non-socket buffferevents support this? */
+/* XXXX Should non-socket bufferevents support this? */
int
bufferevent_priority_set(struct bufferevent *bufev, int priority)
{
return r;
}
-/* XXXX Should non-socket buffferevents support this? */
+/* XXXX Should non-socket bufferevents support this? */
int
bufferevent_base_set(struct event_base *base, struct bufferevent *bufev)
{
int epfd;
struct epollop *epollop;
- /* Initalize the kernel queue. (The size field is ignored since
+ /* Initialize the kernel queue. (The size field is ignored since
* 2.6.8.) */
if ((epfd = epoll_create(32000)) == -1) {
if (errno != ENOSYS)
epollop->epfd = epfd;
- /* Initalize fields */
+ /* Initialize fields */
epollop->events = mm_malloc(INITIAL_NEVENT * sizeof(struct epoll_event));
if (epollop->events == NULL) {
mm_free(epollop);
/** Helper: prepares for a readv/WSARecv call by expanding the buffer to
* hold enough memory to read 'howmuch' bytes in possibly noncontiguous memory.
* Sets up the one or two iovecs in 'vecs' to point to the free memory and its
- * extent, and *chainp to poitn to the first chain that we'll try to read into.
+ * extent, and *chainp to point to the first chain that we'll try to read into.
* Returns the number of vecs used.
*/
int _evbuffer_read_setup_vecs(struct evbuffer *buf, ev_ssize_t howmuch,
* TODO:
* - Support IPv6 and PTR records.
* - Replace all externally visible magic numbers with #defined constants.
- * - Write doccumentation for APIs of all external functions.
+ * - Write documentation for APIs of all external functions.
*/
/* Async DNS Library
status = r;
} else {
++added_any;
- log(EVDNS_LOG_DEBUG,"Succesfully added %s as nameserver",ns->IpAddress.String);
+ log(EVDNS_LOG_DEBUG,"Successfully added %s as nameserver",ns->IpAddress.String);
}
ns = ns->Next;
}
/*
- * Wait continously for events. We exit only if no events are left.
+ * Wait continuously for events. We exit only if no events are left.
*/
int
}
/*
- * we should change the timout state only if the previous event
+ * we should change the timeout state only if the previous event
* addition succeeded.
*/
if (res != -1 && tv != NULL) {
/*
* we already reserved memory above for the case where we
- * are not replacing an exisiting timeout.
+ * are not replacing an existing timeout.
*/
if (ev->ev_flags & EVLIST_TIMEOUT) {
if (min_heap_elt_is_top(ev))
/*
* We can modify the key element of the node without destroying
- * the key, beause we apply it to all in the right order.
+ * the key, because we apply it to all in the right order.
*/
pev = base->timeheap.p;
size = base->timeheap.n;
to redesign the applications. As a result, Libevent allows for portable
application development and provides the most scalable event notification
mechanism available on an operating system. Libevent can also be used for
- multi-threaded aplications; see Steven Grimm's explanation. Libevent should
+ multi-threaded applications; see Steven Grimm's explanation. Libevent should
compile on Linux, *BSD, Mac OS X, Solaris and Windows.
@section usage Standard usage
@section evrpc A framework for RPC servers and clients
- libevents provides a framework for creating RPC servers and clients. It
+ libevent provides a framework for creating RPC servers and clients. It
takes care of marshaling and unmarshaling all data structures.
@section api API Reference
if (!FDI_HAS_EVENTS(fdi) &&
port_dissociate(evpd->ed_port, PORT_SOURCE_FD, fd) == -1) {
/*
- * Ignre EBADFD error the fd could have been closed
+ * Ignore EBADFD error the fd could have been closed
* before event_del() was called.
*/
if (errno != EBADFD) {
evrpc_request_wrapper_free(ctx);
- /* the http layer owned the orignal request structure, but if we
+ /* the http layer owned the original request structure, but if we
* got paused, we asked for ownership and need to free it here. */
if (req != NULL && evhttp_request_is_owned(req))
evhttp_request_free(req);
EVLOCK_LOCK(_lock2_tmplock,mode2); \
} while (0)
-/** Releaes both lock1 and lock2. */
+/** Release both lock1 and lock2. */
#define EVLOCK_UNLOCK2(lock1,lock2,mode1,mode2) \
do { \
void *_lock1_tmplock = (lock1); \
* more data is expected
* return DATA_CORRUPTED:
* data is corrupted
- * return REQUEST_CANCLED:
+ * return REQUEST_CANCELED:
* request was canceled by the user calling evhttp_cancel_request
*/
}
if (!evhttp_header_is_valid_value(value)) {
- event_debug(("%s: dropping illegal header vakye\n", __func__));
+ event_debug(("%s: dropping illegal header value\n", __func__));
return (-1);
}
/*
* Creates a TCP connection to the specified port and executes a callback
- * when finished. Failure or sucess is indicate by the passed connection
+ * when finished. Failure or success is indicate by the passed connection
* object.
*
* Although this interface accepts a hostname, it is intended to take
This function is deprecated. Use bufferevent_socket_new and
bufferevent_set_callbacks instead.
- libevent provides an abstraction on top of the regular event callbacks.
+ Libevent provides an abstraction on top of the regular event callbacks.
This abstraction is called a buffered event. A buffered event provides
input and output buffers that get filled and drained automatically. The
user of a buffered event no longer deals directly with the I/O, but
/** @file ipv6-internal.h
*
- * Replacement types and functions for platfoms that don't support ipv6
+ * Replacement types and functions for platforms that don't support ipv6
* properly.
*/
if (!(kqueueop = mm_calloc(1, sizeof(struct kqop))))
return (NULL);
- /* Initalize the kernel queue */
+ /* Initialize the kernel queue */
if ((kq = kqueue()) == -1) {
event_warn("kqueue");
kqueueop->pid = getpid();
- /* Initalize fields */
+ /* Initialize fields */
kqueueop->changes = mm_malloc(NEVENT * sizeof(struct kevent));
if (kqueueop->changes == NULL) {
mm_free (kqueueop);
if (events[i].flags & EV_ERROR) {
/*
* Error messages that can happen, when a delete fails.
- * EBADF happens when the file discriptor has been
+ * EBADF happens when the file descriptor has been
* closed,
- * ENOENT when the file discriptor was closed and
+ * ENOENT when the file descriptor was closed and
* then reopened.
* EINVAL for some reasons not understood; EINVAL
* should not be returned ever; but FreeBSD does :-\