Commit 49ae22baac96f14d63547c158a87b4de2d8373a8

Carlos Martín Nieto 2014-12-10T01:38:52

stream: constify the write buffer

diff --git a/include/git2/sys/stream.h b/include/git2/sys/stream.h
index 69f8554..c249055 100644
--- a/include/git2/sys/stream.h
+++ b/include/git2/sys/stream.h
@@ -32,7 +32,7 @@ typedef struct git_stream {
 	int (*connect)(struct git_stream *);
 	int (*certificate)(git_cert **, struct git_stream *);
 	ssize_t (*read)(struct git_stream *, void *, size_t);
-	ssize_t (*write)(struct git_stream *, void *, size_t, int);
+	ssize_t (*write)(struct git_stream *, const char *, size_t, int);
 	int (*close)(struct git_stream *);
 	void (*free)(struct git_stream *);
 } git_stream;
diff --git a/src/openssl_stream.c b/src/openssl_stream.c
index 0893bcc..3a6369d 100644
--- a/src/openssl_stream.c
+++ b/src/openssl_stream.c
@@ -277,7 +277,7 @@ int openssl_certificate(git_cert **out, git_stream *stream)
 	return 0;
 }
 
-ssize_t openssl_write(git_stream *stream, void *data, size_t len, int flags)
+ssize_t openssl_write(git_stream *stream, const char *data, size_t len, int flags)
 {
 	openssl_stream *st = (openssl_stream *) stream;
 	int ret;
diff --git a/src/socket_stream.c b/src/socket_stream.c
index ce41fb6..71f4911 100644
--- a/src/socket_stream.c
+++ b/src/socket_stream.c
@@ -131,7 +131,7 @@ int socket_connect(git_stream *stream)
 	return 0;
 }
 
-ssize_t socket_write(git_stream *stream, void *data, size_t len, int flags)
+ssize_t socket_write(git_stream *stream, const char *data, size_t len, int flags)
 {
 	ssize_t ret;
 	size_t off = 0;
diff --git a/src/stream.h b/src/stream.h
index 8eec830..5267d90 100644
--- a/src/stream.h
+++ b/src/stream.h
@@ -30,7 +30,7 @@ GIT_INLINE(ssize_t) git_stream_read(git_stream *st, void *data, size_t len)
 	return st->read(st, data, len);
 }
 
-GIT_INLINE(ssize_t) git_stream_write(git_stream *st, void *data, size_t len, int flags)
+GIT_INLINE(ssize_t) git_stream_write(git_stream *st, const char *data, size_t len, int flags)
 {
 	return st->write(st, data, len, flags);
 }