Skip to content

Commit 7a363a8

Browse files
committed
Revert "closeOnBackpressure should block all further sending"
This reverts commit d4ffead.
1 parent d4ffead commit 7a363a8

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

src/WebSocket.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,11 @@ struct WebSocket : AsyncSocket<SSL> {
9494
(us_socket_context_t *) us_socket_context(SSL, (us_socket_t *) this)
9595
);
9696

97-
/* If we already reached the max backpressure and started a deferred close, reject all sends */
98-
if (webSocketContextData->closeOnBackpressureLimit == 2) {
99-
return DROPPED;
100-
}
101-
10297
/* Skip sending and report success if we are over the limit of maxBackpressure */
10398
if (webSocketContextData->maxBackpressure && webSocketContextData->maxBackpressure < getBufferedAmount()) {
10499
/* Also defer a close if we should */
105-
if (webSocketContextData->closeOnBackpressureLimit == 1) {
100+
if (webSocketContextData->closeOnBackpressureLimit) {
106101
us_socket_shutdown_read(SSL, (us_socket_t *) this);
107-
webSocketContextData->closeOnBackpressureLimit = 2;
108102
}
109103
return DROPPED;
110104
}

src/WebSocketContextData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ struct WebSocketContextData {
7373

7474
/* There needs to be a maxBackpressure which will force close everything over that limit */
7575
size_t maxBackpressure = 0;
76-
unsigned char closeOnBackpressureLimit; /* 0, 1 (or 2 internally) */
76+
bool closeOnBackpressureLimit;
7777
bool resetIdleTimeoutOnSend;
7878
bool sendPingsAutomatically;
7979

0 commit comments

Comments
 (0)