[core] bugfix with ssl read;

v0.5.xx
Alexander Vdolainen 9 years ago
parent deb7c4242f
commit 36dcd56f27

@ -777,7 +777,15 @@ static void *__sxmpl_thread(void *b)
gettimeofday(&beg, NULL);
#endif
memset(mhead, 0, sizeof(sxmplv2_head_t));
rd = __conn_read(co, mhead, sizeof(sxmplv2_head_t));
total_rd = 0;
while(total_rd != sizeof(sxmplv2_head_t)) {
total_rd += __conn_read(co, buf + total_rd, sizeof(sxmplv2_head_t) - total_rd);
if(total_rd == -1) {
co->flags |= SXMP_CLOSED;
break;
}
}
rd = total_rd;
#ifdef _PERFPROFILE
gettimeofday(&end, NULL);
@ -808,7 +816,7 @@ static void *__sxmpl_thread(void *b)
#endif
total_rd = 0;
while(total_rd != mhead->payload_length) {
total_rd += __conn_read(co, bbuf + total_rd, mhead->payload_length);
total_rd += __conn_read(co, bbuf + total_rd, mhead->payload_length - total_rd);
if(total_rd == -1) goto __sslproto_error;
}
rd = total_rd;

Loading…
Cancel
Save