* [ANN] kgio 2.9.0 - cleanups, bug fixes, minor improvements
@ 2014-02-04 3:12 7% Eric Wong
0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2014-02-04 3:12 UTC (permalink / raw)
To: kgio
Changes:
This adds a new kgio_syssend method for Ruby 1.9+ which behaves
like BasicSocket#send, but will not raise exceptions on EAGAIN.
Eric Wong (12):
test_poll: remove race prone test_poll_EINTR_changed test
tryopen: remove RARRAY_PTR usage in init
read_write: remove the rest of RARRAY_PTR usage
my_writev: stylistic fixes
Rakefile: kill raa_update task
avoid downsizing casts
connect: constify RSTRING-related things
set RSTRING_MODIFIED where appropriate for Rubinius
split read_write.c into {read,write,writev}.c
add kgio_syssend method to wrap send(2)
write: correct check for various blocking regions
tryopen: additional debug information for bad Errno values
Hleb Valoshka (1):
Don't use deprecated api
* http://bogomips.org/kgio/
* kgio@librelist.org
* git://bogomips.org/kgio.git
* http://bogomips.org/kgio/NEWS.atom.xml
--
Eric Wong
^ permalink raw reply [relevance 7%]
* [PATCH 3/3] my_writev: stylistic fixes
@ 2013-09-25 19:43 6% ` Eric Wong
0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2013-09-25 19:43 UTC (permalink / raw)
To: kgio
From: Eric Wong <e@yhbt.net>
Rename 'str' to 'ary', as that's the whole point of supporting
writev... Also, long lines need to be wrapped at 80 columns
---
ext/kgio/read_write.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/ext/kgio/read_write.c b/ext/kgio/read_write.c
index 34c619f..fcb48bb 100644
--- a/ext/kgio/read_write.c
+++ b/ext/kgio/read_write.c
@@ -606,12 +606,12 @@ static int writev_check(struct io_args_v *a, long n, const char *msg, int io_wai
return 0;
}
-static VALUE my_writev(VALUE io, VALUE str, int io_wait)
+static VALUE my_writev(VALUE io, VALUE ary, int io_wait)
{
struct io_args_v a;
long n;
- prepare_writev(&a, io, str);
+ prepare_writev(&a, io, ary);
set_nonblocking(a.fd);
do {
@@ -619,12 +619,15 @@ static VALUE my_writev(VALUE io, VALUE str, int io_wait)
if (a.iov_cnt == 0)
n = 0;
else if (a.iov_cnt == 1)
- n = (long)write(a.fd, a.vec[0].iov_base, a.vec[0].iov_len);
+ n = (long)write(a.fd, a.vec[0].iov_base,
+ a.vec[0].iov_len);
/* for big strings use library function */
- else if (USE_WRITEV && a.batch_len / WRITEV_IMPL_THRESHOLD > a.iov_cnt)
+ else if (USE_WRITEV &&
+ ((a.batch_len / WRITEV_IMPL_THRESHOLD) > a.iov_cnt))
n = (long)writev(a.fd, a.vec, a.iov_cnt);
else
- n = (long)custom_writev(a.fd, a.vec, a.iov_cnt, a.batch_len);
+ n = (long)custom_writev(a.fd, a.vec, a.iov_cnt,
+ a.batch_len);
} while (writev_check(&a, n, "writev", io_wait) != 0);
rb_str_resize(a.vec_buf, 0);
--
1.8.3.2.701.g8c4e4ec
^ permalink raw reply related [relevance 6%]
* [PATCH 3/3] my_writev: stylistic fixes
@ 2013-09-25 19:42 6% ` Eric Wong
0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2013-09-25 19:42 UTC (permalink / raw)
To: kgio
From: Eric Wong <e@yhbt.net>
Rename 'str' to 'ary', as that's the whole point of supporting
writev... Also, long lines need to be wrapped at 80 columns
---
ext/kgio/read_write.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/ext/kgio/read_write.c b/ext/kgio/read_write.c
index 34c619f..fcb48bb 100644
--- a/ext/kgio/read_write.c
+++ b/ext/kgio/read_write.c
@@ -606,12 +606,12 @@ static int writev_check(struct io_args_v *a, long n, const char *msg, int io_wai
return 0;
}
-static VALUE my_writev(VALUE io, VALUE str, int io_wait)
+static VALUE my_writev(VALUE io, VALUE ary, int io_wait)
{
struct io_args_v a;
long n;
- prepare_writev(&a, io, str);
+ prepare_writev(&a, io, ary);
set_nonblocking(a.fd);
do {
@@ -619,12 +619,15 @@ static VALUE my_writev(VALUE io, VALUE str, int io_wait)
if (a.iov_cnt == 0)
n = 0;
else if (a.iov_cnt == 1)
- n = (long)write(a.fd, a.vec[0].iov_base, a.vec[0].iov_len);
+ n = (long)write(a.fd, a.vec[0].iov_base,
+ a.vec[0].iov_len);
/* for big strings use library function */
- else if (USE_WRITEV && a.batch_len / WRITEV_IMPL_THRESHOLD > a.iov_cnt)
+ else if (USE_WRITEV &&
+ ((a.batch_len / WRITEV_IMPL_THRESHOLD) > a.iov_cnt))
n = (long)writev(a.fd, a.vec, a.iov_cnt);
else
- n = (long)custom_writev(a.fd, a.vec, a.iov_cnt, a.batch_len);
+ n = (long)custom_writev(a.fd, a.vec, a.iov_cnt,
+ a.batch_len);
} while (writev_check(&a, n, "writev", io_wait) != 0);
rb_str_resize(a.vec_buf, 0);
--
1.8.3.2.701.g8c4e4ec
^ permalink raw reply related [relevance 6%]
Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2013-09-25 19:42 [PATCH 1/3] tryopen: remove RARRAY_PTR usage in init Eric Wong
2013-09-25 19:42 6% ` [PATCH 3/3] my_writev: stylistic fixes Eric Wong
2013-09-25 19:43 [PATCH 1/3] tryopen: remove RARRAY_PTR usage in init Eric Wong
2013-09-25 19:43 6% ` [PATCH 3/3] my_writev: stylistic fixes Eric Wong
2014-02-04 3:12 7% [ANN] kgio 2.9.0 - cleanups, bug fixes, minor improvements Eric Wong
Code repositories for project(s) associated with this public inbox
https://yhbt.net/kgio.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).