Unified · Split
| @@ -42,7 +42,7 @@ struct C9aux { · 41 unmodified lines | |||
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | static const char *nick; | 44 | static const char *nick; |
| 45 | static int printjoin, startlen; | 45 | static int printjoin, startlen, inflight; |
| 46 | static uint64_t chatoff, skipuntil; | 46 | static uint64_t chatoff, skipuntil; |
| 47 | static char start[256]; | 47 | static char start[256]; |
| 48 | 48 | ||
| @@ -176,6 +176,7 @@ ctxchatR(C9ctx *ctx, C9r *r) · 127 unmodified lines | |||
| 176 | break; | 176 | break; |
| 177 | 177 | ||
| 178 | case Rread: | 178 | case Rread: |
| 179 | inflight--; | ||
| 179 | if (chatoff == 0 && skipuntil > 0 && memcmp(start, r->read.data, MIN((int)r->read.size, startlen)) != 0) { | 180 | if (chatoff == 0 && skipuntil > 0 && memcmp(start, r->read.data, MIN((int)r->read.size, startlen)) != 0) { |
| 180 | skipuntil = 0; | 181 | skipuntil = 0; |
| 181 | startlen = 0; | 182 | startlen = 0; |
| @@ -196,11 +197,12 @@ ctxchatR(C9ctx *ctx, C9r *r) · 14 unmodified lines | |||
| 196 | } | 197 | } |
| 197 | /* gotta read fast */ | 198 | /* gotta read fast */ |
| 198 | n = chatoff; | 199 | n = chatoff; |
| 199 | for (i = 0; i < 4; i++) { | 200 | for (i = 0; i < 4-inflight; i++) { |
| 200 | sz = n < skipuntil ? skipuntil-n : Msize; | 201 | sz = n < skipuntil ? skipuntil-n : Msize; |
| 201 | c9read(ctx, &tag, Chatfid, n, sz); | 202 | c9read(ctx, &tag, Chatfid, n, sz); |
| 202 | n += sz; | 203 | n += sz; |
| 203 | } | 204 | } |
| 205 | inflight = 4; | ||
| 204 | break; | 206 | break; |
| 205 | 207 | ||
| 206 | case Rerror: | 208 | case Rerror: |