MCPcopy Create free account
hub / github.com/git/git / socket_read

Function socket_read

imap-send.c:366–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364#endif
365
366static int socket_read(struct imap_socket *sock, char *buf, int len)
367{
368 ssize_t n;
369#ifndef NO_OPENSSL
370 if (sock->ssl)
371 n = SSL_read(sock->ssl, buf, len);
372 else
373#endif
374 n = xread(sock->fd[0], buf, len);
375 if (n <= 0) {
376 socket_perror("read", sock, n);
377 close(sock->fd[0]);
378 close(sock->fd[1]);
379 sock->fd[0] = sock->fd[1] = -1;
380 }
381 return n;
382}
383
384static int socket_write(struct imap_socket *sock, const char *buf, int len)
385{

Callers 1

buffer_getsFunction · 0.85

Calls 2

xreadFunction · 0.85
socket_perrorFunction · 0.85

Tested by

no test coverage detected