Commit 58712fcf authored by jan.koester's avatar jan.koester
Browse files

test

parent c16bc59c
Loading
Loading
Loading
Loading
+6 −4
Changes for src/event/kqueue.cpp: 6 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -498,7 +498,7 @@ namespace netplus {
                                    c->csock->flush_out();
                                } catch (NetException& e) {
                                    if (e.getErrorType() == NetException::Note) {
                                        _batch.add_change(fd, EVFILT_WRITE, EV_ADD | EV_ONESHOT);
                                        rearm.rearm_write();
                                        return;
                                    }
                                    throw;
@@ -537,14 +537,16 @@ namespace netplus {
                                        c->SendData.pos = 0;
                                    }
                                } else {
                                    // No progress, socket full
                                    // No progress, socket full — need WRITE to resume
                                    sendBlockedWouldBlock = true;
                                    break;
                                }
                            }

                            // Send blocked — arm WRITE to resume later
                            if (sendBlockedWouldBlock && c->SendData.pos < c->SendData.size()) {
                            if (sendBlockedWouldBlock || c->csock->hasPendingWrite()) {
                                rearm.rearm_write();
                                if (c->SendData.pos < c->SendData.size())
                                    return;
                            }

@@ -559,7 +561,7 @@ namespace netplus {
                } catch (NetException& e) {
                    if (e.getErrorType() == NetException::Note) {
                        rearm.rearm_read();
                        if (c->csock->hasPendingWrite() || !c->SendData.empty())
                        if (c->csock->hasPendingWrite() || c->SendData.pos < c->SendData.size())
                            rearm.rearm_write();
                        return;
                    }