| 382 | } |
| 383 | |
| 384 | static int socket_write(struct imap_socket *sock, const char *buf, int len) |
| 385 | { |
| 386 | int n; |
| 387 | #ifndef NO_OPENSSL |
| 388 | if (sock->ssl) |
| 389 | n = SSL_write(sock->ssl, buf, len); |
| 390 | else |
| 391 | #endif |
| 392 | n = write_in_full(sock->fd[1], buf, len); |
| 393 | if (n != len) { |
| 394 | socket_perror("write", sock, n); |
| 395 | close(sock->fd[0]); |
| 396 | close(sock->fd[1]); |
| 397 | sock->fd[0] = sock->fd[1] = -1; |
| 398 | } |
| 399 | return n; |
| 400 | } |
| 401 | |
| 402 | static void socket_shutdown(struct imap_socket *sock) |
| 403 | { |
no test coverage detected