|
5 | 5 | #include "git2/transport.h" |
6 | 6 | #include "smart.h" |
7 | 7 |
|
| 8 | +#define DEFAULT_BUFSIZE 65536 |
| 9 | + |
8 | 10 | static const char *upload_pack_ls_service_url = "/info/refs?service=git-upload-pack"; |
9 | 11 | static const char *upload_pack_service_url = "/git-upload-pack"; |
10 | 12 | static const char *receive_pack_ls_service_url = "/info/refs?service=git-receive-pack"; |
@@ -123,25 +125,25 @@ static int emscriptenhttp_action( |
123 | 125 | if (emscriptenhttp_stream_alloc(t, &s) < 0) |
124 | 126 | return -1; |
125 | 127 |
|
126 | | - git_buf buf = GIT_BUF_INIT; |
| 128 | + git_str buf = GIT_STR_INIT; |
127 | 129 |
|
128 | 130 | switch(action) { |
129 | 131 | case GIT_SERVICE_UPLOADPACK_LS: |
130 | | - git_buf_printf(&buf, "%s%s", url, upload_pack_ls_service_url); |
| 132 | + git_str_printf(&buf, "%s%s", url, upload_pack_ls_service_url); |
131 | 133 |
|
132 | 134 | break; |
133 | 135 | case GIT_SERVICE_UPLOADPACK: |
134 | | - git_buf_printf(&buf, "%s%s", url, upload_pack_service_url); |
| 136 | + git_str_printf(&buf, "%s%s", url, upload_pack_service_url); |
135 | 137 | break; |
136 | 138 | case GIT_SERVICE_RECEIVEPACK_LS: |
137 | | - git_buf_printf(&buf, "%s%s", url, receive_pack_ls_service_url); |
| 139 | + git_str_printf(&buf, "%s%s", url, receive_pack_ls_service_url); |
138 | 140 | break; |
139 | 141 | case GIT_SERVICE_RECEIVEPACK: |
140 | | - git_buf_printf(&buf, "%s%s", url, receive_pack_service_url); |
| 142 | + git_str_printf(&buf, "%s%s", url, receive_pack_service_url); |
141 | 143 | break; |
142 | 144 | } |
143 | 145 |
|
144 | | - s->service_url = git_buf_cstr(&buf); |
| 146 | + s->service_url = git_str_cstr(&buf); |
145 | 147 | *stream = &s->parent; |
146 | 148 |
|
147 | 149 | return 0; |
|
0 commit comments