diff --git a/src/buffer b/src/buffer index 59bd994..99adb71 160000 --- a/src/buffer +++ b/src/buffer @@ -1 +1 @@ -Subproject commit 59bd99417558374d53bfeee2551328c51f47cc9a +Subproject commit 99adb71b0bd8cb2c09fd41e52334a9bcf8831327 diff --git a/src/uwsc.c b/src/uwsc.c index 6f5875f..768b799 100644 --- a/src/uwsc.c +++ b/src/uwsc.c @@ -339,10 +339,10 @@ static void uwsc_io_read_cb(struct ev_loop *loop, struct ev_io *w, int revents) #if UWSC_SSL_SUPPORT if (cl->ssl) - ret = buffer_put_fd(rb, w->fd, -1, &eof, uwsc_ssl_read, cl->ssl); + ret = buffer_put_fd_ex(rb, w->fd, -1, &eof, uwsc_ssl_read, cl->ssl); else #endif - ret = buffer_put_fd(rb, w->fd, -1, &eof, NULL, NULL); + ret = buffer_put_fd(rb, w->fd, -1, &eof); if (ret < 0) { uwsc_error(cl, UWSC_ERROR_IO, "read error"); @@ -387,10 +387,10 @@ static void uwsc_io_write_cb(struct ev_loop *loop, struct ev_io *w, int revents) #if UWSC_SSL_SUPPORT if (cl->ssl) - ret = buffer_pull_to_fd(&cl->wb, w->fd, buffer_length(&cl->wb), uwsc_ssl_write, cl->ssl); + ret = buffer_pull_to_fd_ex(&cl->wb, w->fd, buffer_length(&cl->wb), uwsc_ssl_write, cl->ssl); else #endif - ret = buffer_pull_to_fd(&cl->wb, w->fd, buffer_length(&cl->wb), NULL, NULL); + ret = buffer_pull_to_fd(&cl->wb, w->fd, buffer_length(&cl->wb)); if (ret < 0) { uwsc_error(cl, UWSC_ERROR_IO, "write error"); @@ -634,9 +634,6 @@ int uwsc_init(struct uwsc_client *cl, struct ev_loop *loop, const char *url, ev_timer_init(&cl->timer, uwsc_timer_cb, 0.0, 1.0); ev_timer_start(cl->loop, &cl->timer); - buffer_set_persistent_size(&cl->rb, UWSC_BUFFER_PERSISTENT_SIZE); - buffer_set_persistent_size(&cl->wb, UWSC_BUFFER_PERSISTENT_SIZE); - uwsc_handshake(cl, host, port, path, extra_header); return 0; diff --git a/src/uwsc.h b/src/uwsc.h index 72ba2d8..14e42d6 100644 --- a/src/uwsc.h +++ b/src/uwsc.h @@ -33,7 +33,6 @@ #define HTTP_HEAD_LIMIT 4096 #define UWSC_MAX_CONNECT_TIME 5 /* second */ -#define UWSC_BUFFER_PERSISTENT_SIZE 4096 /* WebSocket close status codes defined in RFC 6455, section 11.7 */ enum {