Added binkp PLZ option for test

This commit is contained in:
Michiel Broek 2004-01-25 15:16:11 +00:00
parent 2b0c2481d0
commit bc7be1fb3b
2 changed files with 16 additions and 6 deletions

View File

@ -35,6 +35,9 @@ v0.39.7 14-Jan-2004
session close delay time.
During binkp handshake increased the timer of the receiver to
avoid handshake timeouts.
Added PLZ compression option to binkp. Not yet 100% finished
but it seems to work. Not yet tested against latest Radius beta.
Be carefull!
mbfido:
Removed sync calls that are now in execute.

View File

@ -1892,6 +1892,7 @@ void parse_m_nul(char *msg)
* 0 = Nothing yet
* 1 = Got a frame
* 2 = Frame not processed
* 3 = Uncompress error
*/
int binkp_poll_frame(void)
{
@ -1950,13 +1951,19 @@ int binkp_poll_frame(void)
if (plz) {
Syslog('b', "Binkp: rcvd compressed block %d bytes", bp.rxlen -1);
zbuf = calloc(BINKP_ZIPBUFLEN, sizeof(char));
memmove(zbuf, bp.rxbuf, bp.rxlen -1);
zlen = 0;
rc = uncompress(bp.rxbuf, &zlen, zbuf, bp.rxlen -1);
free(zbuf);
rc = uncompress(zbuf, &zlen, bp.rxbuf, bp.rxlen -1);
Syslog('b', "Binkp: uncompress rc=%d %d => %d", rc, bp.rxlen -1, zlen);
if (rc == Z_OK) {
bp.rxcompressed = (zlen - (bp.rxlen -1));
memmove(bp.rxbuf, zbuf, zlen);
bp.rxlen = zlen +1;
bp.blklen = zlen;
} else {
free(zbuf);
Syslog('!', "Binkp: uncompress error");
return 3;
}
free(zbuf);
}
#endif
Syslog('b', "Binkp: bp.rxlen=%d bp.blklen=%d", bp.rxlen, bp.blklen);