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
7dd22538
Commit
7dd22538
authored
May 11, 2015
by
J Wyman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
centralizing all IO buffer size values
parent
9cdd6578
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
9 deletions
+12
-9
src/blob.c
+1
-1
src/common.h
+5
-0
src/filebuf.c
+1
-1
src/fileops.c
+1
-1
src/filter.c
+2
-4
src/odb.c
+1
-1
src/transports/http.c
+1
-1
No files found.
src/blob.c
View file @
7dd22538
...
@@ -74,7 +74,7 @@ static int write_file_stream(
...
@@ -74,7 +74,7 @@ static int write_file_stream(
git_oid
*
id
,
git_odb
*
odb
,
const
char
*
path
,
git_off_t
file_size
)
git_oid
*
id
,
git_odb
*
odb
,
const
char
*
path
,
git_off_t
file_size
)
{
{
int
fd
,
error
;
int
fd
,
error
;
char
buffer
[
4096
];
char
buffer
[
FILEIO_BUFSIZE
];
git_odb_stream
*
stream
=
NULL
;
git_odb_stream
*
stream
=
NULL
;
ssize_t
read_len
=
-
1
,
written
=
0
;
ssize_t
read_len
=
-
1
,
written
=
0
;
...
...
src/common.h
View file @
7dd22538
...
@@ -68,6 +68,11 @@
...
@@ -68,6 +68,11 @@
#include <regex.h>
#include <regex.h>
#define DEFAULT_BUFSIZE 65536
#define FILEIO_BUFSIZE DEFAULT_BUFSIZE
#define FILTERIO_BUFSIZE DEFAULT_BUFSIZE
#define NETIO_BUFSIZE DEFAULT_BUFSIZE
/**
/**
* Check a pointer allocation result, returning -1 if it failed.
* Check a pointer allocation result, returning -1 if it failed.
*/
*/
...
...
src/filebuf.c
View file @
7dd22538
...
@@ -68,7 +68,7 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
...
@@ -68,7 +68,7 @@ static int lock_file(git_filebuf *file, int flags, mode_t mode)
if
((
flags
&
GIT_FILEBUF_APPEND
)
&&
git_path_exists
(
file
->
path_original
)
==
true
)
{
if
((
flags
&
GIT_FILEBUF_APPEND
)
&&
git_path_exists
(
file
->
path_original
)
==
true
)
{
git_file
source
;
git_file
source
;
char
buffer
[
2048
];
char
buffer
[
FILEIO_BUFSIZE
];
ssize_t
read_bytes
;
ssize_t
read_bytes
;
source
=
p_open
(
file
->
path_original
,
O_RDONLY
);
source
=
p_open
(
file
->
path_original
,
O_RDONLY
);
...
...
src/fileops.c
View file @
7dd22538
...
@@ -689,7 +689,7 @@ int git_futils_fake_symlink(const char *old, const char *new)
...
@@ -689,7 +689,7 @@ int git_futils_fake_symlink(const char *old, const char *new)
static
int
cp_by_fd
(
int
ifd
,
int
ofd
,
bool
close_fd_when_done
)
static
int
cp_by_fd
(
int
ifd
,
int
ofd
,
bool
close_fd_when_done
)
{
{
int
error
=
0
;
int
error
=
0
;
char
buffer
[
4096
];
char
buffer
[
FILEIO_BUFSIZE
];
ssize_t
len
=
0
;
ssize_t
len
=
0
;
while
(
!
error
&&
(
len
=
p_read
(
ifd
,
buffer
,
sizeof
(
buffer
)))
>
0
)
while
(
!
error
&&
(
len
=
p_read
(
ifd
,
buffer
,
sizeof
(
buffer
)))
>
0
)
...
...
src/filter.c
View file @
7dd22538
...
@@ -875,15 +875,13 @@ void stream_list_free(git_vector *streams)
...
@@ -875,15 +875,13 @@ void stream_list_free(git_vector *streams)
git_vector_free
(
streams
);
git_vector_free
(
streams
);
}
}
#define STREAM_BUFSIZE 65536
int
git_filter_list_stream_file
(
int
git_filter_list_stream_file
(
git_filter_list
*
filters
,
git_filter_list
*
filters
,
git_repository
*
repo
,
git_repository
*
repo
,
const
char
*
path
,
const
char
*
path
,
git_writestream
*
target
)
git_writestream
*
target
)
{
{
char
buf
[
STREAM
_BUFSIZE
];
char
buf
[
FILTERIO
_BUFSIZE
];
git_buf
abspath
=
GIT_BUF_INIT
;
git_buf
abspath
=
GIT_BUF_INIT
;
const
char
*
base
=
repo
?
git_repository_workdir
(
repo
)
:
NULL
;
const
char
*
base
=
repo
?
git_repository_workdir
(
repo
)
:
NULL
;
git_vector
filter_streams
=
GIT_VECTOR_INIT
;
git_vector
filter_streams
=
GIT_VECTOR_INIT
;
...
@@ -901,7 +899,7 @@ int git_filter_list_stream_file(
...
@@ -901,7 +899,7 @@ int git_filter_list_stream_file(
goto
done
;
goto
done
;
}
}
while
((
readlen
=
p_read
(
fd
,
buf
,
STREAM_BUFSIZE
))
>
0
)
{
while
((
readlen
=
p_read
(
fd
,
buf
,
sizeof
(
buf
)
))
>
0
)
{
if
((
error
=
stream_start
->
write
(
stream_start
,
buf
,
readlen
))
<
0
)
if
((
error
=
stream_start
->
write
(
stream_start
,
buf
,
readlen
))
<
0
)
goto
done
;
goto
done
;
}
}
...
...
src/odb.c
View file @
7dd22538
...
@@ -142,7 +142,7 @@ void git_odb_object_free(git_odb_object *object)
...
@@ -142,7 +142,7 @@ void git_odb_object_free(git_odb_object *object)
int
git_odb__hashfd
(
git_oid
*
out
,
git_file
fd
,
size_t
size
,
git_otype
type
)
int
git_odb__hashfd
(
git_oid
*
out
,
git_file
fd
,
size_t
size
,
git_otype
type
)
{
{
int
hdr_len
;
int
hdr_len
;
char
hdr
[
64
],
buffer
[
2048
];
char
hdr
[
64
],
buffer
[
FILEIO_BUFSIZE
];
git_hash_ctx
ctx
;
git_hash_ctx
ctx
;
ssize_t
read_len
=
0
;
ssize_t
read_len
=
0
;
int
error
=
0
;
int
error
=
0
;
...
...
src/transports/http.c
View file @
7dd22538
...
@@ -70,7 +70,7 @@ typedef struct {
...
@@ -70,7 +70,7 @@ typedef struct {
gitno_buffer
parse_buffer
;
gitno_buffer
parse_buffer
;
git_buf
parse_header_name
;
git_buf
parse_header_name
;
git_buf
parse_header_value
;
git_buf
parse_header_value
;
char
parse_buffer_data
[
2048
];
char
parse_buffer_data
[
NETIO_BUFSIZE
];
char
*
content_type
;
char
*
content_type
;
char
*
location
;
char
*
location
;
git_vector
www_authenticate
;
git_vector
www_authenticate
;
...
...
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