comparison src/c/urweb.c @ 2283:4afaab523213

Initialize invalidation to NULL!
author Ziv Scully <ziv@mit.edu>
date Thu, 12 Nov 2015 10:06:07 -0500
parents 19b233bb3176
children 472b4504aef2
comparison
equal deleted inserted replaced
2282:19b233bb3176 2283:4afaab523213
583 ctx->output_buffer = malloc(1); 583 ctx->output_buffer = malloc(1);
584 ctx->output_buffer_size = 1; 584 ctx->output_buffer_size = 1;
585 585
586 ctx->numRecording = 0; 586 ctx->numRecording = 0;
587 ctx->recordingOffset = 0; 587 ctx->recordingOffset = 0;
588 ctx->inval = NULL;
588 589
589 ctx->remoteSock = -1; 590 ctx->remoteSock = -1;
590 591
591 return ctx; 592 return ctx;
592 } 593 }
4730 uw_Sqlcache_Inval *inval = malloc(sizeof(uw_Sqlcache_Inval)); 4731 uw_Sqlcache_Inval *inval = malloc(sizeof(uw_Sqlcache_Inval));
4731 inval->cache = cache; 4732 inval->cache = cache;
4732 inval->keys = keys; 4733 inval->keys = keys;
4733 inval->next = NULL; 4734 inval->next = NULL;
4734 if (ctx->inval) { 4735 if (ctx->inval) {
4736 // An invalidation is already registered, so just extend it.
4735 ctx->inval->next = inval; 4737 ctx->inval->next = inval;
4736 } else { 4738 } else {
4737 uw_register_transactional(ctx, inval, uw_Sqlcache_flushCommit, NULL, uw_Sqlcache_flushFree); 4739 uw_register_transactional(ctx, inval, uw_Sqlcache_flushCommit, NULL, uw_Sqlcache_flushFree);
4738 } 4740 }
4741 // [ctx->inval] should always point to the last invalidation.
4739 ctx->inval = inval; 4742 ctx->inval = inval;
4740 } 4743 }