comparison common-channel.c @ 241:c5d3ef11155f

* use own assertions which should get logged properly
author Matt Johnston <matt@ucc.asn.au>
date Mon, 05 Sep 2005 15:16:10 +0000
parents a4b93a2ed879
children 0056419cf0f4
comparison
equal deleted inserted replaced
238:e923801a7678 241:c5d3ef11155f
407 send_msg_channel_window_adjust(channel, channel->recvdonelen); 407 send_msg_channel_window_adjust(channel, channel->recvdonelen);
408 channel->recvwindow += channel->recvdonelen; 408 channel->recvwindow += channel->recvdonelen;
409 channel->recvdonelen = 0; 409 channel->recvdonelen = 0;
410 } 410 }
411 411
412 assert(channel->recvwindow <= RECV_MAXWINDOW); 412 dropbear_assert(channel->recvwindow <= RECV_MAXWINDOW);
413 assert(channel->recvwindow <= cbuf_getavail(channel->writebuf)); 413 dropbear_assert(channel->recvwindow <= cbuf_getavail(channel->writebuf));
414 assert(channel->extrabuf == NULL || 414 dropbear_assert(channel->extrabuf == NULL ||
415 channel->recvwindow <= cbuf_getavail(channel->extrabuf)); 415 channel->recvwindow <= cbuf_getavail(channel->extrabuf));
416 416
417 417
418 TRACE(("leave writechannel")) 418 TRACE(("leave writechannel"))
419 } 419 }
601 /* TRACE(("enter send_msg_channel_data")) 601 /* TRACE(("enter send_msg_channel_data"))
602 TRACE(("extended = %d type = %d", isextended, exttype))*/ 602 TRACE(("extended = %d type = %d", isextended, exttype))*/
603 603
604 CHECKCLEARTOWRITE(); 604 CHECKCLEARTOWRITE();
605 605
606 assert(!channel->sentclosed); 606 dropbear_assert(!channel->sentclosed);
607 607
608 if (isextended) { 608 if (isextended) {
609 fd = channel->errfd; 609 fd = channel->errfd;
610 } else { 610 } else {
611 fd = channel->outfd; 611 fd = channel->outfd;
612 } 612 }
613 assert(fd >= 0); 613 dropbear_assert(fd >= 0);
614 614
615 maxlen = MIN(channel->transwindow, channel->transmaxpacket); 615 maxlen = MIN(channel->transwindow, channel->transmaxpacket);
616 /* -(1+4+4) is SSH_MSG_CHANNEL_DATA, channel number, string length, and 616 /* -(1+4+4) is SSH_MSG_CHANNEL_DATA, channel number, string length, and
617 * exttype if is extended */ 617 * exttype if is extended */
618 maxlen = MIN(maxlen, 618 maxlen = MIN(maxlen,
716 cbuf_incrwrite(cbuf, buflen); 716 cbuf_incrwrite(cbuf, buflen);
717 buf_incrpos(ses.payload, buflen); 717 buf_incrpos(ses.payload, buflen);
718 len -= buflen; 718 len -= buflen;
719 } 719 }
720 720
721 assert(channel->recvwindow >= datalen); 721 dropbear_assert(channel->recvwindow >= datalen);
722 channel->recvwindow -= datalen; 722 channel->recvwindow -= datalen;
723 assert(channel->recvwindow <= RECV_MAXWINDOW); 723 dropbear_assert(channel->recvwindow <= RECV_MAXWINDOW);
724 724
725 TRACE(("leave recv_msg_channel_data")) 725 TRACE(("leave recv_msg_channel_data"))
726 } 726 }
727 727
728 /* Increment the outgoing data window for a channel - the remote end limits 728 /* Increment the outgoing data window for a channel - the remote end limits