diff --git a/templates/smart-http/service.html.ep b/templates/smart-http/service.html.ep
index c754c332..5ecc7123 100644
--- a/templates/smart-http/service.html.ep
+++ b/templates/smart-http/service.html.ep
@@ -36,18 +36,15 @@
my $s = IO::Select->new($cout, $cerr);
my $buffer_size = $ENV{GITPREP_SMART_HTTP_BUFFER_SIZE};
my $error;
- my $output;
my @ready;
my $cb;
$cb = sub {
my $c = shift;
if (@ready = $s->can_read) {
- $output = '';
+ my $output = '';
for my $handle (@ready) {
if (sysread($handle, my $buf, $buffer_size)) {
- #warn `ps axuww|grep gitprep` if $k % 3000 == 0;
-
if ($handle == $cerr) {
$error .= $buf;
}
diff --git a/xt/smart_http.t b/xt/smart_http.t
index a569803f..3df88ddf 100644
--- a/xt/smart_http.t
+++ b/xt/smart_http.t
@@ -89,25 +89,6 @@ note 'Smart HTTP';
$t->content_like(qr/^001e# service=git-upload-pack/);
$t->content_like(qr/multi_ack_detailed/);
- # /git-upload-pack
- {
- my $content = <post_ok(
- '/kimoto/t1.git/git-upload-pack',
- {
- 'Content-Type' => 'application/x-git-upload-pack-request',
- 'Content-Length' => 174,
- 'Content' => $content
- }
- );
- $t->status_is(200);
- $t->content_type_is('application/x-git-upload-pack-result');
- }
-
# /info/refs recieve-pack request(Basic authentication)
$t->get_ok('/kimoto/t1.git/info/refs?service=git-receive-pack');
$t->status_is(401);
@@ -135,6 +116,26 @@ EOS
);
$t->status_is(200);
$t->content_type_is('application/x-git-receive-pack-result');
+
+ # /git-upload-pack
+ {
+ $main::p = 1;
+ my $content = <post_ok(
+ '/kimoto/t1.git/git-upload-pack',
+ {
+ 'Content-Type' => 'application/x-git-upload-pack-request',
+ 'Content-Length' => 174,
+ 'Content' => $content
+ }
+ );
+ $t->status_is(200);
+ $t->content_type_is('application/x-git-upload-pack-result');
+ }
}
note 'Private repository and collaborator';
@@ -190,7 +191,7 @@ note 'Private repository and collaborator';
}
);
$t->status_is(401);
-
+
# Add collaborator
$t->post_ok("/kimoto/t1/settings/collaboration?op=add", form => {collaborator => 'kimoto2'});
$t->content_like(qr/Collaborator kimoto2 is added/);
@@ -205,3 +206,6 @@ note 'Private repository and collaborator';
$t->header_is("Content-Type", "application/x-git-receive-pack-advertisement");
$t->content_like(qr/^001f# service=git-receive-pack/);
}
+
+# Fix test error(why?)
+__END__