summaryrefslogtreecommitdiff
path: root/src/pkt.h
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2012-04-30 17:44:37 +0200
committerCarlos Martín Nieto <carlos@cmartin.tk>2012-04-30 18:24:14 +0200
commit39e6af6a7c526823b06f2c7bfe97c0c7bf9501d5 (patch)
treeb872cbcf20d72c0534c2d0cc2fff0d61a38a42dc /src/pkt.h
parent8b9ec201edf157f84735b8d220c10edafd9f4b5a (diff)
downloadlibgit2-39e6af6a7c526823b06f2c7bfe97c0c7bf9501d5.tar.gz
net: recognize and report server-side error messages
When e.g. a repository isn't found, the server sends an error saying so. Put that error message in our error buffer.
Diffstat (limited to 'src/pkt.h')
-rw-r--r--src/pkt.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pkt.h b/src/pkt.h
index 7e696f70f..75442c833 100644
--- a/src/pkt.h
+++ b/src/pkt.h
@@ -23,6 +23,7 @@ enum git_pkt_type {
GIT_PKT_NAK,
GIT_PKT_PACK,
GIT_PKT_COMMENT,
+ GIT_PKT_ERR,
};
/* Used for multi-ack */
@@ -64,6 +65,11 @@ typedef struct {
char comment[GIT_FLEX_ARRAY];
} git_pkt_comment;
+typedef struct {
+ enum git_pkt_type type;
+ char error[GIT_FLEX_ARRAY];
+} git_pkt_err;
+
int git_pkt_parse_line(git_pkt **head, const char *line, const char **out, size_t len);
int git_pkt_buffer_flush(git_buf *buf);
int git_pkt_send_flush(GIT_SOCKET s);