* void do_read(struct charcb *p_charcb) * * Socket definitely is ready for reading. Read a buffer from the socket and * discard the data. If no data is read, then the socket is closed and the * charcb is removed from the list and freed. **************************************************************/
| 210 | * charcb is removed from the list and freed. |
| 211 | **************************************************************/ |
| 212 | static int do_read(struct charcb *p_charcb) |
| 213 | { |
| 214 | char buffer[80]; |
| 215 | int readcount; |
| 216 | |
| 217 | /* Read some data */ |
| 218 | readcount = read(p_charcb->socket, &buffer, 80); |
| 219 | if (readcount <= 0) |
| 220 | { |
| 221 | close_chargen(p_charcb); |
| 222 | return -1; |
| 223 | } |
| 224 | return 0; |
| 225 | } |
| 226 | |
| 227 | void chargen_init(void) |
| 228 | { |
no test coverage detected