GnuTLS is now supported on client side.

FossilOrigin-Name: 1cb3d6ca96bf4b9447418b5a3983a3abc8918d60ef745cc2600a353f4a7f559b
This commit is contained in:
7u83@mail.ru
2015-02-08 20:07:55 +00:00
parent 7264630ca8
commit 2dd03898b4
21 changed files with 145 additions and 128 deletions

View File

@ -24,10 +24,9 @@
#include "conn.h"
int conn_recv_packet(struct conn* conn,uint8_t *buf,int len)
int conn_recv_packet_(struct conn* conn,uint8_t *buf,int len,int flags)
{
int n;
int flags=0;
while( (n = recv(conn->sock,(char*)buf,len,flags)) < 0 ){
if (errno!=EINTR)
{
@ -40,3 +39,17 @@ int conn_recv_packet(struct conn* conn,uint8_t *buf,int len)
}
/* yes, these functions could be better defined as macros in a .h file */
int conn_recv_packet(struct conn* conn,uint8_t *buf,int len)
{
return conn_recv_packet_(conn,buf,len,0);
}
int conn_recv_packet_peek(struct conn* conn,uint8_t *buf,int len)
{
int rc = conn_recv_packet_(conn,buf,len,MSG_PEEK);
return rc;
}