Revision: 9599 http://pure-data.svn.sourceforge.net/pure-data/?rev=9599&view=rev Author: eighthave Date: 2008-03-17 09:51:48 -0700 (Mon, 17 Mar 2008)
Log Message: ----------- Backported changes from 0.41.2 which fixed bugs related to large network transfers and crashes on Windows when toggling the DSP.
Modified Paths: -------------- branches/pd-extended/v0-40/pd/src/g_io.c branches/pd-extended/v0-40/pd/src/m_obj.c branches/pd-extended/v0-40/pd/src/s_inter.c branches/pd-extended/v0-40/pd/src/u_pdsend.c branches/pd-extended/v0-40/pd/src/x_net.c
Modified: branches/pd-extended/v0-40/pd/src/g_io.c =================================================================== --- branches/pd-extended/v0-40/pd/src/g_io.c 2008-03-17 15:42:57 UTC (rev 9598) +++ branches/pd-extended/v0-40/pd/src/g_io.c 2008-03-17 16:51:48 UTC (rev 9599) @@ -168,6 +168,9 @@ int downsample, int upsample, int reblock, int switched) { t_signal *insig, *outsig; + /* no buffer means we're not a signal inlet */ + if (!x->x_buf) + return; x->x_updown.downsample = downsample; x->x_updown.upsample = upsample;
@@ -435,6 +438,9 @@ int myvecsize, int calcsize, int phase, int period, int frequency, int downsample, int upsample, int reblock, int switched) { + /* no buffer means we're not a signal outlet */ + if (!x->x_buf) + return; x->x_updown.downsample=downsample; x->x_updown.upsample=upsample; x->x_justcopyout = (switched && !reblock);
Modified: branches/pd-extended/v0-40/pd/src/m_obj.c =================================================================== --- branches/pd-extended/v0-40/pd/src/m_obj.c 2008-03-17 15:42:57 UTC (rev 9598) +++ branches/pd-extended/v0-40/pd/src/m_obj.c 2008-03-17 16:51:48 UTC (rev 9599) @@ -736,6 +736,8 @@ { int n = 0; t_inlet *i; + if (x->i_symfrom != &s_signal) + bug("inlet_getsignalindex"); for (i = x->i_owner->ob_inlet, n = 0; i && i != x; i = i->i_next) if (i->i_symfrom == &s_signal) n++; return (n);
Modified: branches/pd-extended/v0-40/pd/src/s_inter.c =================================================================== --- branches/pd-extended/v0-40/pd/src/s_inter.c 2008-03-17 15:42:57 UTC (rev 9598) +++ branches/pd-extended/v0-40/pd/src/s_inter.c 2008-03-17 16:51:48 UTC (rev 9599) @@ -425,12 +425,12 @@ static int socketreceiver_doread(t_socketreceiver *x) { char messbuf[INBUFSIZE], *bp = messbuf; - int indx; + int indx, first = 1; int inhead = x->sr_inhead; int intail = x->sr_intail; char *inbuf = x->sr_inbuf; - if (intail == inhead) return (0); - for (indx = intail; indx != inhead; indx = (indx+1)&(INBUFSIZE-1)) + for (indx = intail; first || (indx != inhead); + first = 0, (indx = (indx+1)&(INBUFSIZE-1))) { /* if we hit a semi that isn't preceeded by a , it's a message boundary. LATER we should deal with the possibility that the @@ -551,6 +551,8 @@ if (x->sr_socketreceivefn) (*x->sr_socketreceivefn)(x->sr_owner, inbinbuf); else binbuf_eval(inbinbuf, 0, 0, 0); + if (x->sr_inhead == x->sr_intail) + break; } } }
Modified: branches/pd-extended/v0-40/pd/src/u_pdsend.c =================================================================== --- branches/pd-extended/v0-40/pd/src/u_pdsend.c 2008-03-17 15:42:57 UTC (rev 9598) +++ branches/pd-extended/v0-40/pd/src/u_pdsend.c 2008-03-17 16:51:48 UTC (rev 9599) @@ -118,7 +118,7 @@ nsend = strlen(buf); for (bp = buf, nsent = 0; nsent < nsend;) { - int res = send(sockfd, buf, nsend-nsent, 0); + int res = send(sockfd, bp, nsend-nsent, 0); if (res < 0) { sockerror("send");
Modified: branches/pd-extended/v0-40/pd/src/x_net.c =================================================================== --- branches/pd-extended/v0-40/pd/src/x_net.c 2008-03-17 15:42:57 UTC (rev 9598) +++ branches/pd-extended/v0-40/pd/src/x_net.c 2008-03-17 16:51:48 UTC (rev 9599) @@ -129,7 +129,7 @@ static double lastwarntime; static double pleasewarn; double timebefore = sys_getrealtime(); - int res = send(x->x_fd, buf, length-sent, 0); + int res = send(x->x_fd, bp, length-sent, 0); double timeafter = sys_getrealtime(); int late = (timeafter - timebefore > 0.005); if (late || pleasewarn)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.