openbsd-ports/net/libshout/patches/patch-src_shout_c
sturm 238f6f0396 update to libshout 2.2
from maintainer Moritz Grimm <gtgbr at gmx.net>
2006-03-14 19:59:01 +00:00

33 lines
989 B
Plaintext

$OpenBSD: patch-src_shout_c,v 1.2 2006/03/14 19:59:01 sturm Exp $
--- src/shout.c.orig Tue Jan 3 19:56:39 2006
+++ src/shout.c Fri Jan 6 12:30:31 2006
@@ -165,6 +165,8 @@ int shout_close(shout_t *self)
if (self->close)
self->close(self);
+ self->close = NULL;
+ self->send = NULL;
sock_close(self->socket);
self->state = SHOUT_STATE_UNCONNECTED;
self->starttime = 0;
@@ -183,6 +185,9 @@ int shout_send(shout_t *self, const unsi
if (self->state != SHOUT_STATE_CONNECTED)
return self->error = SHOUTERR_UNCONNECTED;
+ if (self->send == NULL)
+ return self->error = SHOUTERR_NOCONNECT;
+
if (self->starttime <= 0)
self->starttime = timing_get_time();
@@ -202,6 +207,9 @@ ssize_t shout_send_raw(shout_t *self, co
if (self->state != SHOUT_STATE_CONNECTED)
return SHOUTERR_UNCONNECTED;
+ if (self->send == NULL)
+ return self->error = SHOUTERR_NOCONNECT;
+
self->error = SHOUTERR_SUCCESS;
/* send immediately if possible (should be the common case) */