Renaming
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index a7f21f5..b8dc9b1 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -30,7 +30,7 @@ typedef struct {
typedef struct {
git_smart_subtransport parent;
git_transport *owner;
- git_stream *current_stream;
+ ssh_stream *current_stream;
} ssh_subtransport;
/*
@@ -70,7 +70,7 @@ static int gen_proto(git_buf *request, const char *cmd, const char *url)
return 0;
}
-static int send_command(git_stream *s)
+static int send_command(ssh_stream *s)
{
int error;
git_buf request = GIT_BUF_INIT;
@@ -91,13 +91,13 @@ cleanup:
return error;
}
-static int git_stream_read(
- git_smart_subtransport_stream *stream,
- char *buffer,
- size_t buf_size,
- size_t *bytes_read)
+static int ssh_stream_read(
+ git_smart_subtransport_stream *stream,
+ char *buffer,
+ size_t buf_size,
+ size_t *bytes_read)
{
- git_stream *s = (git_stream *)stream;
+ ssh_stream *s = (ssh_stream *)stream;
gitno_buffer buf;
*bytes_read = 0;
@@ -115,12 +115,12 @@ static int git_stream_read(
return 0;
}
-static int git_stream_write(
- git_smart_subtransport_stream *stream,
- const char *buffer,
- size_t len)
+static int ssh_stream_write(
+ git_smart_subtransport_stream *stream,
+ const char *buffer,
+ size_t len)
{
- git_stream *s = (git_stream *)stream;
+ ssh_stream *s = (ssh_stream *)stream;
if (!s->sent_command && send_command(s) < 0)
return -1;
@@ -128,9 +128,9 @@ static int git_stream_write(
return gitno_send(&s->socket, buffer, len, 0);
}
-static void git_stream_free(git_smart_subtransport_stream *stream)
+static void ssh_stream_free(git_smart_subtransport_stream *stream)
{
- git_stream *s = (git_stream *)stream;
+ ssh_stream *s = (ssh_stream *)stream;
ssh_subtransport *t = OWNING_SUBTRANSPORT(s);
int ret;
@@ -147,24 +147,24 @@ static void git_stream_free(git_smart_subtransport_stream *stream)
git__free(s);
}
-static int git_stream_alloc(
- ssh_subtransport *t,
- const char *url,
- const char *cmd,
- git_smart_subtransport_stream **stream)
+static int ssh_stream_alloc(
+ ssh_subtransport *t,
+ const char *url,
+ const char *cmd,
+ git_smart_subtransport_stream **stream)
{
- git_stream *s;
+ ssh_stream *s;
if (!stream)
return -1;
- s = git__calloc(sizeof(git_stream), 1);
+ s = git__calloc(sizeof(ssh_stream), 1);
GITERR_CHECK_ALLOC(s);
s->parent.subtransport = &t->parent;
- s->parent.read = git_stream_read;
- s->parent.write = git_stream_write;
- s->parent.free = git_stream_free;
+ s->parent.read = ssh_stream_read;
+ s->parent.write = ssh_stream_write;
+ s->parent.free = ssh_stream_free;
s->cmd = cmd;
s->url = git__strdup(url);
@@ -179,22 +179,22 @@ static int git_stream_alloc(
}
static int _git_uploadpack_ls(
- ssh_subtransport *t,
- const char *url,
- git_smart_subtransport_stream **stream)
+ ssh_subtransport *t,
+ const char *url,
+ git_smart_subtransport_stream **stream)
{
char *host, *port, *user=NULL, *pass=NULL;
- git_stream *s;
+ ssh_stream *s;
*stream = NULL;
if (!git__prefixcmp(url, prefix_git))
url += strlen(prefix_git);
- if (git_stream_alloc(t, url, cmd_uploadpack, stream) < 0)
+ if (ssh_stream_alloc(t, url, cmd_uploadpack, stream) < 0)
return -1;
- s = (git_stream *)*stream;
+ s = (ssh_stream *)*stream;
if (gitno_extract_url_parts(&host, &port, &user, &pass, url, GIT_DEFAULT_PORT) < 0)
goto on_error;
@@ -211,7 +211,7 @@ static int _git_uploadpack_ls(
on_error:
if (*stream)
- git_stream_free(*stream);
+ ssh_stream_free(*stream);
git__free(host);
git__free(port);
@@ -219,9 +219,9 @@ on_error:
}
static int _git_uploadpack(
- ssh_subtransport *t,
- const char *url,
- git_smart_subtransport_stream **stream)
+ ssh_subtransport *t,
+ const char *url,
+ git_smart_subtransport_stream **stream)
{
GIT_UNUSED(url);
@@ -235,22 +235,22 @@ static int _git_uploadpack(
}
static int _git_receivepack_ls(
- ssh_subtransport *t,
- const char *url,
- git_smart_subtransport_stream **stream)
+ ssh_subtransport *t,
+ const char *url,
+ git_smart_subtransport_stream **stream)
{
char *host, *port, *user=NULL, *pass=NULL;
- git_stream *s;
+ ssh_stream *s;
*stream = NULL;
if (!git__prefixcmp(url, prefix_git))
url += strlen(prefix_git);
- if (git_stream_alloc(t, url, cmd_receivepack, stream) < 0)
+ if (ssh_stream_alloc(t, url, cmd_receivepack, stream) < 0)
return -1;
- s = (git_stream *)*stream;
+ s = (ssh_stream *)*stream;
if (gitno_extract_url_parts(&host, &port, &user, &pass, url, GIT_DEFAULT_PORT) < 0)
goto on_error;
@@ -267,7 +267,7 @@ static int _git_receivepack_ls(
on_error:
if (*stream)
- git_stream_free(*stream);
+ ssh_stream_free(*stream);
git__free(host);
git__free(port);
@@ -275,9 +275,9 @@ on_error:
}
static int _git_receivepack(
- ssh_subtransport *t,
- const char *url,
- git_smart_subtransport_stream **stream)
+ ssh_subtransport *t,
+ const char *url,
+ git_smart_subtransport_stream **stream)
{
GIT_UNUSED(url);
@@ -291,10 +291,10 @@ static int _git_receivepack(
}
static int _git_action(
- git_smart_subtransport_stream **stream,
- git_smart_subtransport *subtransport,
- const char *url,
- git_smart_service_t action)
+ git_smart_subtransport_stream **stream,
+ git_smart_subtransport *subtransport,
+ const char *url,
+ git_smart_service_t action)
{
ssh_subtransport *t = (ssh_subtransport *) subtransport;