winhttp: netconn_get_next_line() is not used anymore so remove it.

This commit is contained in:
Francois Gouget 2013-03-26 16:27:51 +01:00 committed by Alexandre Julliard
parent ece3fafcda
commit fbe7ab5c5a
2 changed files with 0 additions and 76 deletions

View File

@ -734,81 +734,6 @@ BOOL netconn_query_data_available( netconn_t *conn, DWORD *available )
return TRUE;
}
BOOL netconn_get_next_line( netconn_t *conn, char *buffer, DWORD *buflen )
{
struct pollfd pfd;
BOOL ret = FALSE;
DWORD recvd = 0;
if (!netconn_connected( conn )) return FALSE;
if (conn->secure)
{
while (recvd < *buflen)
{
int dummy;
if (!netconn_recv( conn, &buffer[recvd], 1, 0, &dummy ))
{
set_last_error( ERROR_CONNECTION_ABORTED );
break;
}
if (buffer[recvd] == '\n')
{
ret = TRUE;
break;
}
if (buffer[recvd] != '\r') recvd++;
}
if (ret)
{
buffer[recvd++] = 0;
*buflen = recvd;
TRACE("received line %s\n", debugstr_a(buffer));
}
return ret;
}
pfd.fd = conn->socket;
pfd.events = POLLIN;
while (recvd < *buflen)
{
int timeout, res;
struct timeval tv;
socklen_t len = sizeof(tv);
if ((res = getsockopt( conn->socket, SOL_SOCKET, SO_RCVTIMEO, (void*)&tv, &len ) != -1))
timeout = tv.tv_sec * 1000 + tv.tv_usec / 1000;
else
timeout = -1;
if (poll( &pfd, 1, timeout ) > 0)
{
if ((res = recv( conn->socket, &buffer[recvd], 1, 0 )) <= 0)
{
if (res == -1) set_last_error( sock_get_error( errno ) );
break;
}
if (buffer[recvd] == '\n')
{
ret = TRUE;
break;
}
if (buffer[recvd] != '\r') recvd++;
}
else
{
set_last_error( ERROR_WINHTTP_TIMEOUT );
break;
}
}
if (ret)
{
buffer[recvd++] = 0;
*buflen = recvd;
TRACE("received line %s\n", debugstr_a(buffer));
}
return ret;
}
DWORD netconn_set_timeout( netconn_t *netconn, BOOL send, int value )
{
struct timeval tv;

View File

@ -235,7 +235,6 @@ BOOL netconn_close( netconn_t * ) DECLSPEC_HIDDEN;
BOOL netconn_connect( netconn_t *, const struct sockaddr *, unsigned int, int ) DECLSPEC_HIDDEN;
BOOL netconn_connected( netconn_t * ) DECLSPEC_HIDDEN;
BOOL netconn_create( netconn_t *, int, int, int ) DECLSPEC_HIDDEN;
BOOL netconn_get_next_line( netconn_t *, char *, DWORD * ) DECLSPEC_HIDDEN;
BOOL netconn_init( netconn_t * ) DECLSPEC_HIDDEN;
void netconn_unload( void ) DECLSPEC_HIDDEN;
BOOL netconn_query_data_available( netconn_t *, DWORD * ) DECLSPEC_HIDDEN;