Line data Source code
1 : #include "../burp.h"
2 : #include "sbuf_protocol1.h"
3 : #include "../alloc.h"
4 : #include "../cmd.h"
5 :
6 90138 : static void sbuf_protocol1_init(struct protocol1 *protocol1)
7 : {
8 90138 : iobuf_free_content(&protocol1->datapth);
9 90138 : protocol1->datapth.cmd=CMD_DATAPTH;
10 90138 : }
11 :
12 31757 : struct protocol1 *sbuf_protocol1_alloc(void)
13 : {
14 : struct protocol1 *p;
15 31757 : if((p=(struct protocol1 *)calloc_w(1,
16 : sizeof(struct protocol1), __func__)))
17 31757 : sbuf_protocol1_init(p);
18 31757 : return p;
19 : }
20 :
21 126023 : void sbuf_protocol1_free_content(struct protocol1 *protocol1)
22 : {
23 252046 : if(!protocol1) return;
24 58381 : memset(&(protocol1->rsbuf), 0, sizeof(protocol1->rsbuf));
25 58381 : if(protocol1->sigjob)
26 0 : { rs_job_free(protocol1->sigjob); protocol1->sigjob=NULL; }
27 58381 : rs_filebuf_free(&protocol1->infb);
28 58381 : rs_filebuf_free(&protocol1->outfb);
29 58381 : fzp_close(&protocol1->sigfzp);
30 58381 : fzp_close(&protocol1->fzp);
31 58381 : sbuf_protocol1_init(protocol1);
32 : }
|