I think i found some error in the source!
 
In the crypto\bio\bss_bio.c file there is the following function:
 
static size_t bio_nwrite0(BIO *bio, char **buf)
 {
 struct bio_bio_st *b;
 size_t num;
 size_t write_offset;
 
 BIO_clear_retry_flags(bio);
 
 if (!bio->init)
  return 0;
 
 b = bio->ptr; 
 assert(b != NULL);
 assert(b->peer != NULL);
 assert(b->buf != NULL);
 
 b->request = 0;
 if (b->closed)
  {
  BIOerr(BIO_F_BIO_NWRITE0, BIO_R_BROKEN_PIPE);
  return -1;
  }
 
 assert(b->len <= b->size);
 
 if (b->len == b->size)
  {
  BIO_set_retry_write(bio);
  return -1;
  }
 
 num = b->size - b->len;
 write_offset = b->offset + b->len;
 if (write_offset >= b->size)
  write_offset -= b->size;
 if (write_offset + num > b->size)
  /* no ring buffer wrap-around for non-copying interface
   * (to fulfil the promise by BIO_ctrl_get_write_guarantee,
   * BIO_nwrite may have to be called twice) */
  num = b->size - write_offset;
 
 if (buf != NULL)
  *buf = b->buf + write_offset;
 assert(write_offset + num <= b->size);
 
 return num;
 }
 
I tried to compile by MS-VC it but I got error. The function tries to return -1 but the type of the return value is size_t which is declared as unsigned int. I dont know how to correct this. Is a good solution to return 0? Is there someone who maintains the code?
 
Thanks a lot!

Reply via email to