summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-02-03 11:16:30 +0000
committerMatt Caswell <matt@openssl.org>2015-03-26 15:02:00 +0000
commite2228d318c51c2238ad8667b27574ae06afea191 (patch)
tree5e3da50ac08f8914cf8cf0869be72a8148004bfc
parent295c3f41113f4ff537fb95e29f7f709ba03c6a21 (diff)
Move s->s3->wnum to s->rlayer.wnum
Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r--ssl/record/rec_layer.h2
-rw-r--r--ssl/record/s3_pkt.c14
-rw-r--r--ssl/ssl_locl.h1
3 files changed, 9 insertions, 8 deletions
diff --git a/ssl/record/rec_layer.h b/ssl/record/rec_layer.h
index 9111741f05..0bdb7f527c 100644
--- a/ssl/record/rec_layer.h
+++ b/ssl/record/rec_layer.h
@@ -155,6 +155,8 @@ typedef struct record_layer_st {
unsigned char *packet;
unsigned int packet_length;
+ /* number of bytes sent so far */
+ unsigned int wnum;
} RECORD_LAYER;
diff --git a/ssl/record/s3_pkt.c b/ssl/record/s3_pkt.c
index f024ff58e6..30b5e37e81 100644
--- a/ssl/record/s3_pkt.c
+++ b/ssl/record/s3_pkt.c
@@ -434,9 +434,9 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
}
s->rwstate = SSL_NOTHING;
- OPENSSL_assert(s->s3->wnum <= INT_MAX);
- tot = s->s3->wnum;
- s->s3->wnum = 0;
+ OPENSSL_assert(s->rlayer.wnum <= INT_MAX);
+ tot = s->rlayer.wnum;
+ s->rlayer.wnum = 0;
if (SSL_in_init(s) && !s->in_handshake) {
i = s->handshake_func(s);
@@ -470,7 +470,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
i = ssl3_write_pending(s, type, &buf[tot], s->s3->wpend_tot);
if (i <= 0) {
/* XXX should we ssl3_release_write_buffer if i<0? */
- s->s3->wnum = tot;
+ s->rlayer.wnum = tot;
return i;
}
tot += i; /* this might be last fragment */
@@ -531,7 +531,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
if (s->s3->alert_dispatch) {
i = s->method->ssl_dispatch_alert(s);
if (i <= 0) {
- s->s3->wnum = tot;
+ s->rlayer.wnum = tot;
return i;
}
}
@@ -590,7 +590,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
OPENSSL_free(wb->buf);
wb->buf = NULL;
}
- s->s3->wnum = tot;
+ s->rlayer.wnum = tot;
return i;
}
if (i == (int)n) {
@@ -620,7 +620,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len)
i = do_ssl3_write(s, type, &(buf[tot]), nw, 0);
if (i <= 0) {
/* XXX should we ssl3_release_write_buffer if i<0? */
- s->s3->wnum = tot;
+ s->rlayer.wnum = tot;
return i;
}
diff --git a/ssl/ssl_locl.h b/ssl/ssl_locl.h
index 056051a2e1..64962d9439 100644
--- a/ssl/ssl_locl.h
+++ b/ssl/ssl_locl.h
@@ -1246,7 +1246,6 @@ typedef struct ssl3_state_st {
unsigned char handshake_fragment[4];
unsigned int handshake_fragment_len;
/* partial write - check the numbers match */
- unsigned int wnum; /* number of bytes sent so far */
int wpend_tot; /* number bytes written */
int wpend_type;
int wpend_ret; /* number of bytes submitted */