X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=blobdiff_plain;f=libevent%2Fbuffer_iocp.c;h=5d5303eb0485ad3f8b8648435e79b7a10004f477;hp=67c89c2a27913734aa863290484288efc7d4a263;hb=3a84db87064922ad10ac10cc1d6833380e575995;hpb=313b5f94348618d65523c1d8bde1fba9988f040a diff --git a/libevent/buffer_iocp.c b/libevent/buffer_iocp.c index 67c89c2a..5d5303eb 100644 --- a/libevent/buffer_iocp.c +++ b/libevent/buffer_iocp.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009-2010 Niels Provos and Nick Mathewson + * Copyright (c) 2009-2012 Niels Provos and Nick Mathewson * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -126,6 +126,9 @@ evbuffer_commit_read(struct evbuffer *evbuf, ev_ssize_t nBytes) buf->read_in_progress = 0; evbuf->total_len += nBytes; + evbuf->n_add_for_cb += nBytes; + + evbuffer_invoke_callbacks(evbuf); _evbuffer_decref_and_unlock(evbuf); } @@ -150,6 +153,8 @@ evbuffer_overlapped_new(evutil_socket_t fd) struct evbuffer_overlapped *evo; evo = mm_calloc(1, sizeof(struct evbuffer_overlapped)); + if (!evo) + return NULL; TAILQ_INIT(&evo->buffer.callbacks); evo->buffer.refcnt = 1;