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
c06e180a
Commit
c06e180a
authored
May 20, 2015
by
Carlos Martín Nieto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3137 from libgit2/cmn/server-errors
Improve server error reporting
parents
acc573cb
1396c381
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
3 deletions
+25
-3
CHANGELOG.md
+9
-0
include/git2/errors.h
+1
-0
src/openssl_stream.c
+1
-0
src/transports/smart_protocol.c
+2
-2
src/transports/ssh.c
+12
-1
No files found.
CHANGELOG.md
View file @
c06e180a
...
...
@@ -45,6 +45,10 @@ support for HTTPS connections insead of OpenSSL.
*
The index now uses diffs for
`add_all()`
and
`update_all()`
which
gives it a speed boost and closer semantics to git.
*
The ssh transport now reports the stderr output from the server as
the error message, which allows you to get the "repository not
found" messages.
### API additions
...
...
@@ -89,6 +93,11 @@ support for HTTPS connections insead of OpenSSL.
*
`git_stash_pop()`
will apply a stashed state (like
`git_stash_apply()`
)
but will remove the stashed state after a successful application.
*
A new error code
`GIT_EEOF`
indicates an early EOF from the
server. This typically indicates an error with the URL or
configuration of the server, and tools can use this to show messages
about failing to communicate with the server.
### API removals
*
`git_remote_save()`
and
`git_remote_clear_refspecs()`
has been
...
...
include/git2/errors.h
View file @
c06e180a
...
...
@@ -45,6 +45,7 @@ typedef enum {
GIT_ECERTIFICATE
=
-
17
,
/**< Server certificate is invalid */
GIT_EAPPLIED
=
-
18
,
/**< Patch/merge has already been applied */
GIT_EPEEL
=
-
19
,
/**< The requested peel operation is not possible */
GIT_EEOF
=
-
20
,
/**< Unexpected EOF */
GIT_PASSTHROUGH
=
-
30
,
/**< Internal only */
GIT_ITEROVER
=
-
31
,
/**< Signals end of iteration with iterator */
...
...
src/openssl_stream.c
View file @
c06e180a
...
...
@@ -55,6 +55,7 @@ static int ssl_set_error(SSL *ssl, int error)
break
;
}
giterr_set
(
GITERR_NET
,
"SSL error: received early EOF"
);
return
GIT_EEOF
;
break
;
case
SSL_ERROR_SSL
:
e
=
ERR_get_error
();
...
...
src/transports/smart_protocol.c
View file @
c06e180a
...
...
@@ -52,7 +52,7 @@ int git_smart__store_refs(transport_smart *t, int flushes)
if
(
recvd
==
0
&&
!
flush
)
{
giterr_set
(
GITERR_NET
,
"early EOF"
);
return
-
1
;
return
GIT_EEOF
;
}
continue
;
...
...
@@ -770,7 +770,7 @@ static int parse_report(transport_smart *transport, git_push *push)
if
(
recvd
==
0
)
{
giterr_set
(
GITERR_NET
,
"early EOF"
);
return
-
1
;
return
GIT_EEOF
;
}
continue
;
}
...
...
src/transports/ssh.c
View file @
c06e180a
...
...
@@ -125,10 +125,21 @@ static int ssh_stream_read(
return
-
1
;
if
((
rc
=
libssh2_channel_read
(
s
->
channel
,
buffer
,
buf_size
))
<
LIBSSH2_ERROR_NONE
)
{
ssh_error
(
s
->
session
,
"SSH could not read data"
);
;
ssh_error
(
s
->
session
,
"SSH could not read data"
);
return
-
1
;
}
/*
* If we can't get anything out of stdout, it's typically a
* not-found error, so read from stderr and signal EOF on
* stderr.
*/
if
(
rc
==
0
&&
(
rc
=
libssh2_channel_read_stderr
(
s
->
channel
,
buffer
,
buf_size
))
>
0
)
{
giterr_set
(
GITERR_SSH
,
"%*s"
,
rc
,
buffer
);
return
GIT_EEOF
;
}
*
bytes_read
=
rc
;
return
0
;
...
...
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