* void close_chargen(struct charcb *p_charcb) * * Close the socket and remove this charcb from the list. **************************************************************/
| 179 | * Close the socket and remove this charcb from the list. |
| 180 | **************************************************************/ |
| 181 | static void close_chargen(struct charcb *p_charcb) |
| 182 | { |
| 183 | struct charcb *p_search_charcb; |
| 184 | |
| 185 | /* Either an error or tcp connection closed on other |
| 186 | * end. Close here */ |
| 187 | closesocket(p_charcb->socket); |
| 188 | |
| 189 | /* Free charcb */ |
| 190 | if (charcb_list == p_charcb) |
| 191 | charcb_list = p_charcb->next; |
| 192 | else |
| 193 | for (p_search_charcb = charcb_list; p_search_charcb; p_search_charcb = p_search_charcb->next) |
| 194 | { |
| 195 | if (p_search_charcb->next == p_charcb) |
| 196 | { |
| 197 | p_search_charcb->next = p_charcb->next; |
| 198 | break; |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | rt_free(p_charcb); |
| 203 | } |
| 204 | |
| 205 | /************************************************************** |
| 206 | * void do_read(struct charcb *p_charcb) |
no test coverage detected