Browse Source

also advance cur if upstream is a bytestream or an iobuf

master
Felix von Leitner 10 months ago
parent
commit
81def53a7d
  1. 9
      buffer/prs_readblob.c

9
buffer/prs_readblob.c

@ -19,7 +19,13 @@ ssize_t prs_readblob(struct bytestream* bs,unsigned char* dest,size_t destlen) {
break;
case IOBUF:
buffer_get(bs->u.b, (char*)dest, destlen);
r=buffer_get(bs->u.b, (char*)dest, destlen);
if (r != (ssize_t)destlen) {
bs->cur = 1; // set bytestream to error state
bs->max = 0;
return -1;
}
bs->cur += r;
break;
case BSTREAM:
@ -30,6 +36,7 @@ ssize_t prs_readblob(struct bytestream* bs,unsigned char* dest,size_t destlen) {
bs->max = 0;
return -1;
}
bs->cur += r;
break;
}

Loading…
Cancel
Save