aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Dudka <kdudka@redhat.com>2017-07-20 08:05:59 +0200
committerKamil Dudka <kdudka@redhat.com>2017-07-20 08:08:47 +0200
commitc89eb6d0f87a3620074bc04a6af255e5dc3a523e (patch)
tree23b62c0c1146c1f7f2eb1cba267868c41cac7f95
parentda6aa3f76382e6ddf471dad198c507b7c7704ffb (diff)
nss: unify the coding style of nss_send() and nss_recv()
No changes in behavior intended by this commit.
-rw-r--r--lib/vtls/nss.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c
index 0097caf01..ac3730fdb 100644
--- a/lib/vtls/nss.c
+++ b/lib/vtls/nss.c
@@ -2181,8 +2181,10 @@ static ssize_t nss_send(struct connectdata *conn, /* connection data */
size_t len, /* amount to write */
CURLcode *curlcode)
{
- ssize_t rc = PR_Send(conn->ssl[sockindex].handle, mem, (int)len, 0,
- PR_INTERVAL_NO_WAIT);
+ struct ssl_connect_data *connssl = &conn->ssl[sockindex];
+ ssize_t rc;
+
+ rc = PR_Send(connssl->handle, mem, (int)len, 0, PR_INTERVAL_NO_WAIT);
if(rc < 0) {
PRInt32 err = PR_GetError();
if(err == PR_WOULD_BLOCK_ERROR)
@@ -2206,14 +2208,17 @@ static ssize_t nss_send(struct connectdata *conn, /* connection data */
return rc; /* number of bytes */
}
-static ssize_t nss_recv(struct connectdata * conn, /* connection data */
- int num, /* socketindex */
+static ssize_t nss_recv(struct connectdata *conn, /* connection data */
+ int sockindex, /* socketindex */
char *buf, /* store read data here */
size_t buffersize, /* max amount to read */
CURLcode *curlcode)
{
- ssize_t nread = PR_Recv(conn->ssl[num].handle, buf, (int)buffersize, 0,
- PR_INTERVAL_NO_WAIT);
+ struct ssl_connect_data *connssl = &conn->ssl[sockindex];
+ ssize_t nread;
+
+ nread = PR_Recv(connssl->handle, buf, (int)buffersize, 0,
+ PR_INTERVAL_NO_WAIT);
if(nread < 0) {
/* failed SSL read */
PRInt32 err = PR_GetError();