Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
4a6621fd
Commit
4a6621fd
authored
Nov 29, 2012
by
Philip Kelley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Leverage the min macro from util.h
parent
6762fe08
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
src/transports/http.c
+1
-2
src/transports/winhttp.c
+2
-4
No files found.
src/transports/http.c
View file @
4a6621fd
...
...
@@ -30,7 +30,6 @@ static const char *basic_authtype = "Basic";
#define PARSE_ERROR_REPLAY -2
#define CHUNK_SIZE 4096
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
enum
last_cb
{
NONE
,
...
...
@@ -542,7 +541,7 @@ static int http_stream_write_chunked(
}
else
{
/* Append as much to the buffer as we can */
int
count
=
MIN
(
CHUNK_SIZE
-
s
->
chunk_buffer_len
,
len
);
int
count
=
min
(
CHUNK_SIZE
-
s
->
chunk_buffer_len
,
len
);
if
(
!
s
->
chunk_buffer
)
s
->
chunk_buffer
=
git__malloc
(
CHUNK_SIZE
);
...
...
src/transports/winhttp.c
View file @
4a6621fd
...
...
@@ -30,8 +30,6 @@
#define CACHED_POST_BODY_BUF_SIZE 4096
#define UUID_LENGTH_CCH 32
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
static
const
char
*
prefix_http
=
"http://"
;
static
const
char
*
prefix_https
=
"https://"
;
static
const
char
*
upload_pack_service
=
"upload-pack"
;
...
...
@@ -395,7 +393,7 @@ replay:
DWORD
bytes_written
;
if
(
!
ReadFile
(
s
->
post_body
,
buffer
,
MIN
(
CACHED_POST_BODY_BUF_SIZE
,
len
),
min
(
CACHED_POST_BODY_BUF_SIZE
,
len
),
&
bytes_read
,
NULL
)
||
!
bytes_read
)
{
git__free
(
buffer
);
...
...
@@ -699,7 +697,7 @@ static int winhttp_stream_write_chunked(
}
else
{
/* Append as much to the buffer as we can */
int
count
=
MIN
(
CACHED_POST_BODY_BUF_SIZE
-
s
->
chunk_buffer_len
,
len
);
int
count
=
min
(
CACHED_POST_BODY_BUF_SIZE
-
s
->
chunk_buffer_len
,
len
);
if
(
!
s
->
chunk_buffer
)
s
->
chunk_buffer
=
git__malloc
(
CACHED_POST_BODY_BUF_SIZE
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment