diff --git a/nsock/src/filespace.c b/nsock/src/filespace.c index 7f3d5a74d..a4acc2ae6 100644 --- a/nsock/src/filespace.c +++ b/nsock/src/filespace.c @@ -66,7 +66,6 @@ /* Assumes space for fs has already been allocated */ int filespace_init(struct filespace *fs, int initial_size) { - memset(fs, 0, sizeof(struct filespace)); if (initial_size == 0) initial_size = FS_INITSIZE_DEFAULT; @@ -95,11 +94,6 @@ int fs_cat(struct filespace *fs, const char *str, int len) { if (len == 0) return 0; - /* - printf("fscat: current_alloc=%d; current_size=%d; len=%d\n", - fs->current_alloc, fs->current_size, len); - */ - if (fs->current_alloc - fs->current_size < len + 2) { char *tmpstr; diff --git a/nsock/src/filespace.h b/nsock/src/filespace.h index fc92416d9..784354999 100644 --- a/nsock/src/filespace.h +++ b/nsock/src/filespace.h @@ -92,7 +92,7 @@ static inline int fs_length(const struct filespace *fs) { return fs->current_size; } -static inline char * fs_str(const struct filespace *fs) { +static inline char *fs_str(const struct filespace *fs) { return fs->str; } diff --git a/nsock/src/nsock_read.c b/nsock/src/nsock_read.c index a17e69935..b18cdb8a1 100644 --- a/nsock/src/nsock_read.c +++ b/nsock/src/nsock_read.c @@ -66,7 +66,8 @@ * NSE_STATUS_SUCCESS will be returned in the case of EOF or tiemout if at least * 1 char has been read. Also note that you may get more than 'nlines' back -- * we just stop once "at least" 'nlines' is read */ -nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler handler, int timeout_msecs, +nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod, + nsock_ev_handler handler, int timeout_msecs, void *userdata, int nlines) { msiod *nsi = (msiod *)ms_iod; mspool *ms = (mspool *)nsp; @@ -87,7 +88,8 @@ nsock_event_id nsock_readlines(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle } /* Same as above, except it tries to read at least 'nbytes' instead of 'nlines'. */ -nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler handler, int timeout_msecs, +nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod, + nsock_ev_handler handler, int timeout_msecs, void *userdata, int nbytes) { msiod *nsi = (msiod *)ms_iod; @@ -111,7 +113,9 @@ nsock_event_id nsock_readbytes(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handle /* The simplest read function -- returns NSE_STATUS_SUCCESS when it * reads anything, otherwise it returns timeout, eof, or error as appropriate */ -nsock_event_id nsock_read(nsock_pool nsp, nsock_iod ms_iod, nsock_ev_handler handler, int timeout_msecs, void *userdata) { +nsock_event_id nsock_read(nsock_pool nsp, nsock_iod ms_iod, + nsock_ev_handler handler, int timeout_msecs, + void *userdata) { msiod *nsi = (msiod *)ms_iod; mspool *ms = (mspool *)nsp; msevent *nse;