diff options
author | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-14 23:35:09 +0800 |
---|---|---|
committer | wens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204> | 2009-06-14 23:35:09 +0800 |
commit | efcb25b78a9a91a309433347795b2df0c60d0972 (patch) | |
tree | 1ec418343d049d90f513f733467bd25fb68edd21 | |
parent | 1eca07c1d585327cebdaa48d9b9d012e9b39adae (diff) | |
download | pttbbs-efcb25b78a9a91a309433347795b2df0c60d0972.tar pttbbs-efcb25b78a9a91a309433347795b2df0c60d0972.tar.gz pttbbs-efcb25b78a9a91a309433347795b2df0c60d0972.tar.bz2 pttbbs-efcb25b78a9a91a309433347795b2df0c60d0972.tar.lz pttbbs-efcb25b78a9a91a309433347795b2df0c60d0972.tar.xz pttbbs-efcb25b78a9a91a309433347795b2df0c60d0972.tar.zst pttbbs-efcb25b78a9a91a309433347795b2df0c60d0972.zip |
Bufferevent error callback is REQUIRED
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@4614 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
-rw-r--r-- | daemon/logind/logind.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/daemon/logind/logind.c b/daemon/logind/logind.c index a816115f..d322e16c 100644 --- a/daemon/logind/logind.c +++ b/daemon/logind/logind.c @@ -1068,6 +1068,15 @@ endconn_cb(int fd, short event, void *arg) if (g_verbose) fprintf(stderr, " done.\r\n"); } +static void +endconn_cb_buffer(struct bufferevent * evb, short event, void *arg) +{ + login_conn_ctx *conn = (login_conn_ctx*) arg; + + // "event" for bufferevent and normal event are different + endconn_cb(EVENT_FD(&conn->ev), 0, arg); +} + static void login_conn_remove(login_conn_ctx *conn, int fd, int sleep_sec) { @@ -1231,7 +1240,7 @@ listen_cb(int lfd, short event, void *arg) } memset(conn, 0, sizeof(login_conn_ctx)); - if ((conn->bufev = bufferevent_new(fd, NULL, NULL, NULL, NULL)) == NULL) { + if ((conn->bufev = bufferevent_new(fd, NULL, NULL, endconn_cb_buffer, conn)) == NULL) { free(conn); close(fd); return; |