diff --git a/dlls/winhttp/net.c b/dlls/winhttp/net.c index 631939ab93..bc835424f9 100644 --- a/dlls/winhttp/net.c +++ b/dlls/winhttp/net.c @@ -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; diff --git a/dlls/winhttp/winhttp_private.h b/dlls/winhttp/winhttp_private.h index b19aadfec1..82b4582210 100644 --- a/dlls/winhttp/winhttp_private.h +++ b/dlls/winhttp/winhttp_private.h @@ -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;