Changeset 581db2477ea3eaaf110a4a18e3cc68b74e03ca42
- Timestamp:
- 08/27/10 02:15:48
(3 years ago)
- Author:
- Theo Schlossnagle <jesus@omniti.com>
- git-committer:
- Theo Schlossnagle <jesus@omniti.com> 1282875348 +0000
- git-parent:
[2ad45ba32f23135b7459830293b6998f013e58cb]
- git-author:
- Theo Schlossnagle <jesus@omniti.com> 1282875348 +0000
- Message:
fixes #311
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc6a5f68 |
r581db24 |
|
| 370 | 370 | ctx->state = JLOG_STREAMER_WANT_INITIATE; |
|---|
| 371 | 371 | ctx->count = 0; |
|---|
| | 372 | ctx->needs_chkpt = 0; |
|---|
| 372 | 373 | ctx->bytes_read = 0; |
|---|
| 373 | 374 | ctx->bytes_expected = 0; |
|---|
| … | … | |
| 412 | 413 | memcpy(&dummy.count, ctx->buffer, sizeof(u_int32_t)); |
|---|
| 413 | 414 | ctx->count = ntohl(dummy.count); |
|---|
| | 415 | ctx->needs_chkpt = 0; |
|---|
| 414 | 416 | free(ctx->buffer); ctx->buffer = NULL; |
|---|
| 415 | 417 | if(ctx->count < 0) |
|---|
| … | … | |
| 437 | 439 | case JLOG_STREAMER_WANT_BODY: |
|---|
| 438 | 440 | FULLREAD(e, ctx, (unsigned long)ctx->header.message_len); |
|---|
| 439 | | if(ctx->header.message_len > 0) |
|---|
| | 441 | if(ctx->header.message_len > 0) { |
|---|
| | 442 | ctx->needs_chkpt = 1; |
|---|
| 440 | 443 | ctx->push(DS_OP_INSERT, &nctx->r.remote, nctx->remote_cn, |
|---|
| 441 | 444 | ctx->buffer, NULL); |
|---|
| | 445 | } |
|---|
| 442 | 446 | else if(ctx->buffer) |
|---|
| 443 | 447 | free(ctx->buffer); |
|---|
| … | … | |
| 446 | 450 | ctx->count--; |
|---|
| 447 | 451 | ctx->total_events++; |
|---|
| 448 | | if(ctx->count == 0) { |
|---|
| | 452 | if(ctx->count == 0 && ctx->needs_chkpt) { |
|---|
| 449 | 453 | eventer_t completion_e; |
|---|
| 450 | 454 | eventer_remove_fd(e->fd); |
|---|
| … | … | |
| 462 | 466 | noit_connection_disable_timeout(nctx); |
|---|
| 463 | 467 | return 0; |
|---|
| 464 | | } else |
|---|
| | 468 | } |
|---|
| | 469 | else if(ctx->count == 0) |
|---|
| | 470 | ctx->state = JLOG_STREAMER_WANT_CHKPT; |
|---|
| | 471 | else |
|---|
| 465 | 472 | ctx->state = JLOG_STREAMER_WANT_HEADER; |
|---|
| 466 | 473 | break; |
|---|
| r61a5e1f |
r581db24 |
|
| 87 | 87 | } state; |
|---|
| 88 | 88 | int count; /* Number of jlog messages we need to read */ |
|---|
| | 89 | int needs_chkpt; |
|---|
| 89 | 90 | struct { |
|---|
| 90 | 91 | jlog_id chkpt; |
|---|