Skip to content

Commit

Permalink
Use system defined IOV_MAX instead of 10000.
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Nov 30, 2010
1 parent d7dbdcb commit f7f802e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/node_io_watcher.cc
Expand Up @@ -8,6 +8,7 @@

#include <sys/uio.h> /* writev */
#include <errno.h>
#include <limits.h> /* IOV_MAX */

#include <sys/types.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -246,8 +247,7 @@ void IOWatcher::Dump(EV_P_ ev_prepare *w, int revents) {
void IOWatcher::Dump() {
HandleScope scope;

#define IOV_SIZE 10000
static struct iovec iov[IOV_SIZE];
static struct iovec iov[IOV_MAX];

// Loop over all watchers in the dump queue. Each one stands for a socket
// that has stuff to be written out.
Expand Down Expand Up @@ -322,7 +322,7 @@ void IOWatcher::Dump() {
// break if iov contains a lot of data
to_write < max_to_write &&
// break if iov is running out of space
iovcnt < IOV_SIZE;
iovcnt < IOV_MAX;
bucket_v = bucket->Get(next_sym), bucket_index++) {
assert(bucket_v->IsObject());
bucket = bucket_v->ToObject();
Expand Down

0 comments on commit f7f802e

Please sign in to comment.