stream: constify the write buffer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
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);
}