comparison channel.h @ 707:564e7f87ecc3

Fix memory leak when direct TCP connections time out on connection. Long-standing bug probably stemming from the awkwardly named delete_channel() versus remove_channel()
author Matt Johnston <matt@ucc.asn.au>
date Tue, 19 Mar 2013 23:54:32 +0800
parents 17962b2a6b8f
children 4a274f47eabd
comparison
equal deleted inserted replaced
706:002cf09827c0 707:564e7f87ecc3
59 void* typedata; /* a pointer to type specific data */ 59 void* typedata; /* a pointer to type specific data */
60 int writefd; /* read from wire, written to insecure side */ 60 int writefd; /* read from wire, written to insecure side */
61 int readfd; /* read from insecure side, written to wire */ 61 int readfd; /* read from insecure side, written to wire */
62 int errfd; /* used like writefd or readfd, depending if it's client or server. 62 int errfd; /* used like writefd or readfd, depending if it's client or server.
63 Doesn't exactly belong here, but is cleaner here */ 63 Doesn't exactly belong here, but is cleaner here */
64 circbuffer *writebuf; /* data from the wire, for local consumption */ 64 circbuffer *writebuf; /* data from the wire, for local consumption. Can be
65 initially NULL */
65 circbuffer *extrabuf; /* extended-data for the program - used like writebuf 66 circbuffer *extrabuf; /* extended-data for the program - used like writebuf
66 but for stderr */ 67 but for stderr */
67 68
68 /* whether close/eof messages have been exchanged */ 69 /* whether close/eof messages have been exchanged */
69 int sent_close, recv_close; 70 int sent_close, recv_close;
100 void chaninitialise(const struct ChanType *chantypes[]); 101 void chaninitialise(const struct ChanType *chantypes[]);
101 void chancleanup(); 102 void chancleanup();
102 void setchannelfds(fd_set *readfd, fd_set *writefd); 103 void setchannelfds(fd_set *readfd, fd_set *writefd);
103 void channelio(fd_set *readfd, fd_set *writefd); 104 void channelio(fd_set *readfd, fd_set *writefd);
104 struct Channel* getchannel(); 105 struct Channel* getchannel();
105 struct Channel* newchannel(unsigned int remotechan,
106 const struct ChanType *type,
107 unsigned int transwindow, unsigned int transmaxpacket);
108 106
109 void recv_msg_channel_open(); 107 void recv_msg_channel_open();
110 void recv_msg_channel_request(); 108 void recv_msg_channel_request();
111 void send_msg_channel_failure(struct Channel *channel); 109 void send_msg_channel_failure(struct Channel *channel);
112 void send_msg_channel_success(struct Channel *channel); 110 void send_msg_channel_success(struct Channel *channel);