openslp/openslp.tcpclearovr.diff

28 lines
1.1 KiB
Diff

--- ./slpd/slpd_incoming.c.orig 2005-12-23 14:13:55.000000000 +0000
+++ ./slpd/slpd_incoming.c 2005-12-23 14:42:26.000000000 +0000
@@ -63,6 +63,7 @@
/*=========================================================================*/
#include "slp_xmalloc.h"
#include "slp_message.h"
+#include "slp_v1message.h"
/*=========================================================================*/
@@ -242,6 +243,16 @@ void IncomingStreamRead(SLPList* socklis
sock->state = SOCKET_CLOSE;
break;
default:
+ /* some clients cannot cope with the OVERFLOW
+ * bit set on a TCP stream, so always clear it
+ */
+ if (sock->sendbuf && sock->sendbuf->end - sock->sendbuf->start > 5)
+ {
+ if (sock->sendbuf->start[0] == 1)
+ sock->sendbuf->start[4] &= ~SLPv1_FLAG_OVERFLOW;
+ else
+ sock->sendbuf->start[5] &= ~(SLP_FLAG_OVERFLOW >> 8);
+ }
sock->state = STREAM_WRITE_FIRST;
IncomingStreamWrite(socklist, sock);
}