/* 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
#include <stdio.h>
#include <errno.h>
#define USE_SOCKETS
-#include "evp.h"
-#include "buffer.h"
#include "ssl_locl.h"
+#include <openssl/evp.h>
+#include <openssl/buffer.h>
-int ssl23_write_bytes(s)
-SSL *s;
+int ssl23_write_bytes(SSL *s)
{
int i,num,tot;
char *buf;
{
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;
}
}
-/* 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;