struct connectdata *conn = data->conn;
RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN);
CURLcode result = CURLE_OK;
- ssize_t nread;
+ ssize_t rv;
(void)sockindex;
*pnread = 0;
if(!r)
return CURLE_FAILED_INIT;
- nread = RTMP_Read(r, buf, curlx_uztosi(len));
- if(nread < 0) {
+ rv = RTMP_Read(r, buf, curlx_uztosi(len));
+ if(!curlx_sztouz(rv, pnread)) {
if(r->m_read.status == RTMP_READ_COMPLETE ||
r->m_read.status == RTMP_READ_EOF) {
data->req.size = data->req.bytecount;
else
result = CURLE_RECV_ERROR;
}
- else
- *pnread = (size_t)nread;
return result;
}
{
struct connectdata *conn = data->conn;
RTMP *r = Curl_conn_meta_get(conn, CURL_META_RTMP_CONN);
- ssize_t nwritten;
+ ssize_t rv;
(void)sockindex;
(void)eos;
if(!r)
return CURLE_FAILED_INIT;
- nwritten = RTMP_Write(r, (const char *)buf, curlx_uztosi(len));
- if(nwritten < 0)
+ rv = RTMP_Write(r, (const char *)buf, curlx_uztosi(len));
+ if(!curlx_sztouz(rv, pnwritten))
return CURLE_SEND_ERROR;
- *pnwritten = (size_t)nwritten;
return CURLE_OK;
}