summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-11-13 17:04:37 +0100
committerLars-Dominik Braun <lars@6xq.net>2011-11-13 17:16:21 +0100
commit28f2ad12316f73eef454fb3cde5ea06a69b9e778 (patch)
treed9dcc59a51704c3f2be1c954b065dbd2fe4c45a0 /src
parentcc4fe9fe07a7bee817be8402cfbd3b082360b9f9 (diff)
downloadpianobar-28f2ad12316f73eef454fb3cde5ea06a69b9e778.tar.gz
pianobar-28f2ad12316f73eef454fb3cde5ea06a69b9e778.tar.bz2
pianobar-28f2ad12316f73eef454fb3cde5ea06a69b9e778.zip
waitress: Fix ssize_t/size_t confusion
Diffstat (limited to 'src')
-rw-r--r--src/libwaitress/waitress.c14
-rw-r--r--src/libwaitress/waitress.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libwaitress/waitress.c b/src/libwaitress/waitress.c
index 1aeea90..498576d 100644
--- a/src/libwaitress/waitress.c
+++ b/src/libwaitress/waitress.c
@@ -508,18 +508,19 @@ static ssize_t WaitressPollRead (void *data, void *buf, size_t count) {
}
static WaitressReturn_t WaitressOrdinaryRead (void *data, char *buf,
- const size_t size, ssize_t *retSize) {
+ const size_t size, size_t *retSize) {
WaitressHandle_t *waith = data;
const ssize_t ret = WaitressPollRead (waith, buf, size);
if (ret != -1) {
- *retSize = ret;
+ assert (ret >= 0);
+ *retSize = (size_t) ret;
}
return waith->request.readWriteRet;
}
static WaitressReturn_t WaitressGnutlsRead (void *data, char *buf,
- const size_t size, ssize_t *retSize) {
+ const size_t size, size_t *retSize) {
WaitressHandle_t *waith = data;
ssize_t ret = gnutls_record_recv (waith->request.tlsSession, buf, size);
@@ -804,7 +805,7 @@ static WaitressReturn_t WaitressConnect (WaitressHandle_t *waith) {
/* set up proxy tunnel */
if (WaitressProxyEnabled (waith)) {
char buf[256];
- ssize_t size;
+ size_t size;
WaitressReturn_t wRet;
snprintf (buf, sizeof (buf), "CONNECT %s:%s HTTP/"
@@ -929,8 +930,7 @@ static WaitressReturn_t WaitressSendRequest (WaitressHandle_t *waith) {
static WaitressReturn_t WaitressReceiveHeaders (WaitressHandle_t *waith,
size_t *retRemaining) {
char * const buf = waith->request.buf;
- size_t bufFilled = 0;
- ssize_t recvSize = 0;
+ size_t bufFilled = 0, recvSize = 0;
char *nextLine = NULL, *thisLine = NULL;
enum {HDRM_HEAD, HDRM_LINES, HDRM_FINISHED} hdrParseMode = HDRM_HEAD;
WaitressReturn_t wRet = WAITRESS_RET_OK;
@@ -1018,7 +1018,7 @@ static WaitressReturn_t WaitressReceiveResponse (WaitressHandle_t *waith) {
assert (waith->request.buf != NULL);
char * const buf = waith->request.buf;
- ssize_t recvSize = 0;
+ size_t recvSize = 0;
WaitressReturn_t wRet = WAITRESS_RET_OK;
if ((wRet = WaitressReceiveHeaders (waith, &recvSize)) != WAITRESS_RET_OK) {
diff --git a/src/libwaitress/waitress.h b/src/libwaitress/waitress.h
index b489e86..b988591 100644
--- a/src/libwaitress/waitress.h
+++ b/src/libwaitress/waitress.h
@@ -103,7 +103,7 @@ typedef struct {
gnutls_session_t tlsSession;
/* first argument is WaitressHandle_t, but that's not defined yet */
WaitressHandlerReturn_t (*dataHandler) (void *, char *, const size_t);
- WaitressReturn_t (*read) (void *, char *, const size_t, ssize_t *);
+ WaitressReturn_t (*read) (void *, char *, const size_t, size_t *);
WaitressReturn_t (*write) (void *, const char *, const size_t);
/* temporary return value storage */
WaitressReturn_t readWriteRet;