Dolda2000 GitWeb
/
jagi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
794a5c9
)
Fixed some event-server channel-transfer bugs.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 19 Feb 2022 00:45:28 +0000
(
01:45
+0100)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sat, 19 Feb 2022 00:45:28 +0000
(
01:45
+0100)
src/jagi/scgi/EventServer.java
patch
|
blob
|
blame
|
history
diff --git
a/src/jagi/scgi/EventServer.java
b/src/jagi/scgi/EventServer.java
index
202b8dd
..
8218973
100644
(file)
--- a/
src/jagi/scgi/EventServer.java
+++ b/
src/jagi/scgi/EventServer.java
@@
-115,7
+115,7
@@
public class EventServer implements Runnable {
public void handle(int events) throws IOException {
if(!eof && (buf.remaining() == 0)) {
public void handle(int events) throws IOException {
if(!eof && (buf.remaining() == 0)) {
- buf.
rewind
();
+ buf.
clear
();
while(buf.remaining() > 0) {
if(in.read(buf) < 0)
break;
while(buf.remaining() > 0) {
if(in.read(buf) < 0)
break;
@@
-168,7
+168,7
@@
public class EventServer implements Runnable {
public void handle(int events) throws IOException {
double now = Driver.current().time();
if((events & SelectionKey.OP_READ) != 0) {
public void handle(int events) throws IOException {
double now = Driver.current().time();
if((events & SelectionKey.OP_READ) != 0) {
- buf.
rewind
();
+ buf.
clear
();
if(buf.remaining() > max - cur)
buf.limit(buf.position() + (int)Math.min(max - cur, Integer.MAX_VALUE));
int rv = sk.read(buf);
if(buf.remaining() > max - cur)
buf.limit(buf.position() + (int)Math.min(max - cur, Integer.MAX_VALUE));
int rv = sk.read(buf);
@@
-176,7
+176,8
@@
public class EventServer implements Runnable {
eof = true;
} else if(rv > 0) {
lastread = now;
eof = true;
} else if(rv > 0) {
lastread = now;
- cur += rv;
+ if((cur += rv) >= max)
+ eof = true;
}
buf.flip();
while(buf.remaining() > 0)
}
buf.flip();
while(buf.remaining() > 0)