Skip to content
This repository has been archived by the owner on Sep 10, 2021. It is now read-only.

Commit

Permalink
Fix nbytes>0 assertion failure when using a EM.kqueue with EM.start_s…
Browse files Browse the repository at this point in the history
…erver
  • Loading branch information
tmm1 committed Jan 22, 2009
1 parent 353a30b commit 64d0925
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions ext/ed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,7 @@ ConnectionDescriptor::ConnectionDescriptor (int sd, EventMachine_t *em):
#ifdef HAVE_EPOLL
EpollEvent.events = EPOLLOUT;
#endif
#ifdef HAVE_KQUEUE
MyEventMachine->ArmKqueueWriter (this);
#endif
// 22Jan09: Moved ArmKqueueWriter into SetConnectPending() to fix assertion failure in _WriteOutboundData()
}


Expand Down Expand Up @@ -263,6 +261,17 @@ int ConnectionDescriptor::ReportErrorStatus (const char *binding)
return -1;
}

/***************************************
ConnectionDescriptor::SetConnectPending
****************************************/

void ConnectionDescriptor::SetConnectPending(bool f)
{
bConnectPending = f;
#ifdef HAVE_KQUEUE
MyEventMachine->ArmKqueueWriter (this);
#endif
}


/**************************************
Expand Down
2 changes: 1 addition & 1 deletion ext/ed.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class ConnectionDescriptor: public EventableDescriptor

int SendOutboundData (const char*, int);

void SetConnectPending (bool f) { bConnectPending = f; }
void SetConnectPending (bool f);

void SetNotifyReadable (bool readable) { bNotifyReadable = readable; }
void SetNotifyWritable (bool writable) { bNotifyWritable = writable; }
Expand Down

0 comments on commit 64d0925

Please sign in to comment.