clogger 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -44,10 +44,11 @@ release_changes := release_changes-$(VERSION).txt
44
44
  $(release_changes): verify
45
45
  git diff --stat $(vPREV) v$(VERSION) > $@+
46
46
  echo >> $@+
47
- git log $(vPREV) v$(VERSION) >> $@+
47
+ git log $(vPREV)..v$(VERSION) >> $@+
48
48
  $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
49
49
  $(release_notes): verify package
50
50
  gem spec pkg/clogger-$(VERSION).gem description | sed -ne '/\w/p' > $@+
51
+ echo >> $@+
51
52
  git cat-file tag v$(VERSION) | awk 'p>1{print $$0}/^$$/{++p}' >> $@+
52
53
  $(VISUAL) $@+ && test -s $@+ && mv $@+ $@
53
54
  verify:
@@ -65,11 +66,11 @@ package: verify
65
66
 
66
67
  # not using Hoe's release system since we release 2 gems but only one tgz
67
68
  release: package Manifest.txt $(release_notes) $(release_changes)
68
- rubyforge add_release -f -n $(release_notes) -c $(release_changes) \
69
+ rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
69
70
  clogger clogger $(VERSION) pkg/clogger-$(VERSION).gem
70
71
  rubyforge add_file \
71
72
  clogger clogger $(VERSION) pkg/clogger-$(VERSION).tgz
72
- rubyforge add_release -f -n $(release_notes) -c $(release_changes) \
73
+ rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
73
74
  clogger clogger_ext $(VERSION) pkg/clogger_ext-$(VERSION).gem
74
75
  endif
75
76
 
@@ -1,3 +1,11 @@
1
+ === 0.0.3 / 2009-08-29
2
+
3
+ The MRI extension clogger_ext gets GC bug fix and
4
+ cleanups/robustness improvements. It should now be more
5
+ tolerant of misbehaving applications in that it'll be less
6
+ likely to segfault. No changes to the (recommended) pure
7
+ implementation.
8
+
1
9
  === 0.0.2 / 2009-08-29
2
10
 
3
11
  * 2 bug fixes
@@ -188,7 +188,7 @@ struct response_ops { long nr; VALUE ops; };
188
188
  static VALUE swap_sent_headers(VALUE kv, VALUE memo)
189
189
  {
190
190
  struct response_ops *tmp = (struct response_ops *)memo;
191
- VALUE key = RARRAY_PTR(kv)[0];
191
+ VALUE key = rb_obj_as_string(RARRAY_PTR(kv)[0]);
192
192
  long i = RARRAY_LEN(tmp->ops);
193
193
  VALUE *ary = RARRAY_PTR(tmp->ops);
194
194
  VALUE value;
@@ -248,7 +248,13 @@ static void clogger_mark(void *ptr)
248
248
  {
249
249
  struct clogger *c = ptr;
250
250
 
251
- rb_gc_mark_locations(&c->app, &c->response);
251
+ rb_gc_mark(c->app);
252
+ rb_gc_mark(c->fmt_ops);
253
+ rb_gc_mark(c->logger);
254
+ rb_gc_mark(c->log_buf);
255
+ rb_gc_mark(c->env);
256
+ rb_gc_mark(c->cookies);
257
+ rb_gc_mark(c->response);
252
258
  }
253
259
 
254
260
  static VALUE clogger_alloc(VALUE klass)
@@ -331,10 +337,11 @@ static VALUE clogger_wrap_body(VALUE self)
331
337
  return clogger_get(self)->wrap_body == 0 ? Qfalse : Qtrue;
332
338
  }
333
339
 
334
- static void append_status(struct clogger *c, VALUE status)
340
+ static void append_status(struct clogger *c)
335
341
  {
336
342
  char buf[sizeof("999")];
337
343
  int nr;
344
+ VALUE status = RARRAY_PTR(c->response)[0];
338
345
 
339
346
  if (TYPE(status) != T_FIXNUM) {
340
347
  status = rb_funcall(status, to_i_id, 0);
@@ -536,7 +543,7 @@ static void special_var(struct clogger *c, enum clogger_special var)
536
543
  append_body_bytes_sent(c);
537
544
  break;
538
545
  case CL_SP_status:
539
- append_status(c, RARRAY_PTR(c->response)[0]);
546
+ append_status(c);
540
547
  break;
541
548
  case CL_SP_request:
542
549
  append_request(c);
@@ -667,6 +674,7 @@ static VALUE body_iter_i(VALUE str, VALUE memop)
667
674
  {
668
675
  off_t *len = (off_t *)memop;
669
676
 
677
+ str = rb_obj_as_string(str);
670
678
  *len += RSTRING_LEN(str);
671
679
 
672
680
  return rb_yield(str);
@@ -676,7 +684,6 @@ static VALUE wrap_each(struct clogger *c)
676
684
  {
677
685
  VALUE body = RARRAY_PTR(c->response)[2];
678
686
 
679
- rb_need_block();
680
687
  c->body_bytes_sent = 0;
681
688
  rb_iterate(rb_each, body, body_iter_i, (VALUE)&c->body_bytes_sent);
682
689
 
@@ -695,6 +702,8 @@ static VALUE clogger_each(VALUE self)
695
702
  {
696
703
  struct clogger *c = clogger_get(self);
697
704
 
705
+ rb_need_block();
706
+
698
707
  return rb_ensure(wrap_each, (VALUE)c, cwrite, (VALUE)c);
699
708
  }
700
709
 
@@ -1,6 +1,6 @@
1
1
  # -*- encoding: binary -*-
2
2
  class Clogger
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
 
5
5
  OP_LITERAL = 0
6
6
  OP_REQUEST = 1
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clogger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Wong