mirror of
https://github.com/owntone/owntone-server.git
synced 2025-04-19 02:15:18 -04:00
io.c: Fix rebuffering issue on win32 (fixing #235)
webserver.c: Fix write error log messages. Possible fix for crash on mipsel (uninitialized heap issue).
This commit is contained in:
parent
4966f4213e
commit
01c7d18758
13
src/io.c
13
src/io.c
@ -2148,6 +2148,9 @@ int io_listen_accept(IO_PRIVHANDLE *phandle, IO_PRIVHANDLE *pchild,
|
|||||||
struct sockaddr_in client;
|
struct sockaddr_in client;
|
||||||
SOCKET_T child_fd;
|
SOCKET_T child_fd;
|
||||||
IO_SOCKET_PRIV *priv;
|
IO_SOCKET_PRIV *priv;
|
||||||
|
#ifdef WIN32
|
||||||
|
long blocking = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
ASSERT(phandle);
|
ASSERT(phandle);
|
||||||
ASSERT(pchild);
|
ASSERT(pchild);
|
||||||
@ -2176,6 +2179,12 @@ int io_listen_accept(IO_PRIVHANDLE *phandle, IO_PRIVHANDLE *pchild,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
if(ioctlsocket(child_fd,FIONBIO,&blocking)) {
|
||||||
|
io_err_printf(IO_LOG_LOG,"Couldn't set socket to blocking\n");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
io_err_printf(IO_LOG_DEBUG,"Got listen socket %d\n",child_fd);
|
io_err_printf(IO_LOG_DEBUG,"Got listen socket %d\n",child_fd);
|
||||||
|
|
||||||
/* copy host, if passed a buffer */
|
/* copy host, if passed a buffer */
|
||||||
@ -2277,7 +2286,7 @@ int io_socket_write(IO_PRIVHANDLE *phandle, unsigned char *buf,uint32_t *len) {
|
|||||||
int slen;
|
int slen;
|
||||||
|
|
||||||
uint32_t bytestowrite;
|
uint32_t bytestowrite;
|
||||||
ssize_t byteswritten;
|
ssize_t byteswritten=0;
|
||||||
uint32_t totalbytes;
|
uint32_t totalbytes;
|
||||||
unsigned char *bufp;
|
unsigned char *bufp;
|
||||||
|
|
||||||
@ -2318,8 +2327,10 @@ int io_socket_write(IO_PRIVHANDLE *phandle, unsigned char *buf,uint32_t *len) {
|
|||||||
#endif
|
#endif
|
||||||
if((byteswritten == -1 ) && (errno != EINTR)) {
|
if((byteswritten == -1 ) && (errno != EINTR)) {
|
||||||
io_socket_seterr(phandle,IO_E_SOCKET_OTHER);
|
io_socket_seterr(phandle,IO_E_SOCKET_OTHER);
|
||||||
|
*len = totalbytes;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(byteswritten == -1)
|
if(byteswritten == -1)
|
||||||
byteswritten = 0;
|
byteswritten = 0;
|
||||||
totalbytes += byteswritten;
|
totalbytes += byteswritten;
|
||||||
|
@ -1203,7 +1203,7 @@ int ws_writefd(WS_CONNINFO *pwsc, char *fmt, ...) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
WS_EXIT();
|
WS_EXIT();
|
||||||
return len;
|
return (int)len;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,6 +75,7 @@ typedef INT64 int64_t;
|
|||||||
#define strncasecmp strnicmp
|
#define strncasecmp strnicmp
|
||||||
#define strcasecmp stricmp
|
#define strcasecmp stricmp
|
||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
|
#define vsnprintf _vsnprintf
|
||||||
#define access _access
|
#define access _access
|
||||||
|
|
||||||
#define readdir_r os_readdir_r
|
#define readdir_r os_readdir_r
|
||||||
|
@ -290,10 +290,6 @@
|
|||||||
RelativePath="..\src\scan-mp3.c"
|
RelativePath="..\src\scan-mp3.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\src\scan-mp4.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\src\scan-ogg.c"
|
RelativePath="..\src\scan-ogg.c"
|
||||||
>
|
>
|
||||||
@ -493,10 +489,6 @@
|
|||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath=".\ReadMe.txt"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
|
@ -124,7 +124,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalIncludeDirectories="..;..\..\src"
|
AdditionalIncludeDirectories="..;..\..\src"
|
||||||
PreprocessorDefinitions="HAVE_CONFIG_H;WIN32"
|
PreprocessorDefinitions="HAVE_CONFIG_H;WIN32"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL;WIN32;PLUGIN"
|
PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL;WIN32;PLUGIN"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="true"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
@ -125,7 +125,7 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
AdditionalIncludeDirectories="..\win32;.;..\src"
|
AdditionalIncludeDirectories="..\win32;.;..\src"
|
||||||
PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL;WIN32;PLUGIN"
|
PreprocessorDefinitions="_WIN32;HAVE_CONFIG_H;ZLIB_DLL;WIN32;PLUGIN"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="0"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="3"
|
||||||
Detect64BitPortabilityProblems="true"
|
Detect64BitPortabilityProblems="true"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user