Skip to content

Commit

Permalink
Revert "fix smart http bug"
Browse files Browse the repository at this point in the history
This reverts commit 3b18906.
  • Loading branch information
yuki-kimoto committed Mar 28, 2016
1 parent 3b18906 commit b4be027
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
9 changes: 6 additions & 3 deletions templates/smart-http/service.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,24 @@
$cb = sub {
my $c = shift;
if (@ready = $s->can_read) {
$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 if defined $buf;
$error .= $buf;
}
else {
$output .= $buf if defined $buf;
$output .= $buf;
}
}
else {
$s->remove($handle);
}
}
$c->write_chunk($output, $cb) if defined $output;
$c->write_chunk($output, $cb);
}
else {
$c->finish;
Expand Down
39 changes: 19 additions & 20 deletions xt/smart_http.t
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,25 @@ note 'Smart HTTP';
$t->content_like(qr/^001e# service=git-upload-pack/);
$t->content_like(qr/multi_ack_detailed/);

# /git-upload-pack
{
my $content = <<EOS;
006fwant 6410316f2ed260666a8a6b9a223ad3c95d7abaed multi_ack_detailed no-done side-band-64k thin-pack ofs-delta
0032want 6410316f2ed260666a8a6b9a223ad3c95d7abaed
00000009done
EOS
$t->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);
Expand Down Expand Up @@ -116,26 +135,6 @@ note 'Smart HTTP';
);
$t->status_is(200);
$t->content_type_is('application/x-git-receive-pack-result');

# /git-upload-pack
{
$main::ppp = 1;
my $content = <<EOS;
006fwant 6410316f2ed260666a8a6b9a223ad3c95d7abaed multi_ack_detailed no-done side-band-64k thin-pack ofs-delta
0032want 6410316f2ed260666a8a6b9a223ad3c95d7abaed
00000009done
EOS
$t->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';
Expand Down

0 comments on commit b4be027

Please sign in to comment.