Commit c17d35d4 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

audioscrobbler: call recv() and document some existing bugs

With waitall set to false, net_Read() is identical to recv()
outside the input thread. This avoids allocating a bogus waitpipe.
parent 79ae74fa
...@@ -38,6 +38,9 @@ ...@@ -38,6 +38,9 @@
#include <assert.h> #include <assert.h>
#include <time.h> #include <time.h>
#ifdef HAVE_POLL
# include <poll.h>
#endif
#define VLC_MODULE_LICENSE VLC_LICENSE_GPL_2_PLUS #define VLC_MODULE_LICENSE VLC_LICENSE_GPL_2_PLUS
#include <vlc_common.h> #include <vlc_common.h>
...@@ -829,8 +832,13 @@ static void *Run(void *data) ...@@ -829,8 +832,13 @@ static void *Run(void *data)
continue; continue;
} }
i_net_ret = net_Read(p_intf, i_post_socket, NULL, /* FIXME: this might wait forever */
p_buffer, sizeof(p_buffer) - 1, false); struct pollfd ufd = { .fd = i_post_socket, .events = POLLIN };
while( poll( &ufd, 1, -1 ) == -1 );
/* FIXME: With TCP, you should never assume that a single read will
* return the entire response... */
i_net_ret = recv(i_post_socket, p_buffer, sizeof(p_buffer) - 1, 0);
if (i_net_ret <= 0) if (i_net_ret <= 0)
{ {
/* if we get no answer, something went wrong : try again */ /* if we get no answer, something went wrong : try again */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment