line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cogit::Protocol::Git; |
2
|
|
|
|
|
|
|
$Cogit::Protocol::Git::VERSION = '0.001001'; |
3
|
4
|
|
|
4
|
|
20
|
use Moo; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
20
|
|
4
|
4
|
|
|
4
|
|
7127
|
use MooX::Types::MooseLike::Base qw( Int Str ); |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
188
|
|
5
|
4
|
|
|
4
|
|
1880
|
use IO::Socket::INET; |
|
4
|
|
|
|
|
39708
|
|
|
4
|
|
|
|
|
28
|
|
6
|
4
|
|
|
4
|
|
1634
|
use namespace::clean; |
|
4
|
|
|
|
|
13
|
|
|
4
|
|
|
|
|
39
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
extends 'Cogit::Protocol'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has hostname => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
isa => Str, |
13
|
|
|
|
|
|
|
required => 1, |
14
|
|
|
|
|
|
|
); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
has port => ( |
17
|
|
|
|
|
|
|
is => 'ro', |
18
|
|
|
|
|
|
|
isa => Int, |
19
|
|
|
|
|
|
|
default => sub { 9418 }, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
has project => ( |
23
|
|
|
|
|
|
|
is => 'rw', |
24
|
|
|
|
|
|
|
isa => Str, |
25
|
|
|
|
|
|
|
required => 1, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub connect_socket { |
29
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
0
|
|
|
|
my $socket = IO::Socket::INET->new( |
32
|
|
|
|
|
|
|
PeerAddr => $self->hostname, |
33
|
|
|
|
|
|
|
PeerPort => $self->port, |
34
|
|
|
|
|
|
|
Proto => 'tcp' |
35
|
|
|
|
|
|
|
) || die $! . ' ' . $self->hostname . ':' . $self->port; |
36
|
0
|
0
|
|
|
|
|
$socket->autoflush(1) || die $!; |
37
|
0
|
|
|
|
|
|
$self->read_socket($socket); |
38
|
0
|
|
|
|
|
|
$self->write_socket($socket); |
39
|
|
|
|
|
|
|
|
40
|
0
|
|
|
|
|
|
$self->send_line( |
41
|
|
|
|
|
|
|
"git-upload-pack " . $self->project . "\0host=" . $self->hostname . "\0"); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=encoding UTF-8 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Cogit::Protocol::Git |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 VERSION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
version 0.001001 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 AUTHOR |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Arthur Axel "fREW" Schmidt <cogit@afoolishmanifesto.com> |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Arthur Axel "fREW" Schmidt. |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
69
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=cut |