X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=ssl%2Fs23_pkt.c;h=f45e1ce3d806ce0baa7c6abe86b1d09ca83a03a1;hp=e9b2add0b8ff777ed64507bf4862f85af26d715f;hb=3f2599d97d6ffe26e81eb46c43c7f0905c8fb762;hpb=eda1f21f1af8b6f77327e7b37573af9c1ba73726 diff --git a/ssl/s23_pkt.c b/ssl/s23_pkt.c index e9b2add0b8..f45e1ce3d8 100644 --- a/ssl/s23_pkt.c +++ b/ssl/s23_pkt.c @@ -1,5 +1,5 @@ /* ssl/s23_pkt.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -59,12 +59,11 @@ #include #include #define USE_SOCKETS -#include "evp.h" -#include "buffer.h" +#include +#include #include "ssl_locl.h" -int ssl23_write_bytes(s) -SSL *s; +int ssl23_write_bytes(SSL *s) { int i,num,tot; char *buf; @@ -76,7 +75,7 @@ SSL *s; { s->rwstate=SSL_WRITING; i=BIO_write(s->wbio,&(buf[tot]),num); - if (i < 0) + if (i <= 0) { s->init_off=tot; s->init_num=num; @@ -90,10 +89,8 @@ SSL *s; } } -/* only return when we have read 'n' bytes */ -int ssl23_read_bytes(s,n) -SSL *s; -int n; +/* return regularly only when we have read (at least) 'n' bytes */ +int ssl23_read_bytes(SSL *s, int n) { unsigned char *p; int j;