ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/loop.C
(Generate patch)

Comparing deliantra/server/socket/loop.C (file contents):
Revision 1.55 by root, Sun Jul 1 05:00:20 2007 UTC vs.
Revision 1.59 by root, Fri Jul 6 03:52:51 2007 UTC

199 199
200 if (facedata *d = face_data (ix.idx, faceset)) 200 if (facedata *d = face_data (ix.idx, faceset))
201 { 201 {
202 if (fxix) 202 if (fxix)
203 { 203 {
204 // 9 bytes is enough for fx_FFFOOO, 40 leaves some room for image data 204 // only transfer something if the amount of data transferred
205 // has a healthy relation to the header overhead
206 if (avail <= 40)
207 break;
208
209 // 9 bytes is enough for fx_FFFOOO
205 int chunk = min (min (avail - 40, MAXSOCKBUF - 9), ix.ofs); 210 int chunk = min (min (avail, MAXSOCKBUF - 9), (int)ix.ofs);
206 211
207 if (chunk <= 0) 212 if (chunk <= 0)
208 break; 213 break;
209 214
210 ix.ofs -= chunk; 215 ix.ofs -= chunk;
216
217 //fprintf (stderr, "i%dx %6d: %5d+%4d (%4d)\n", fxix, ix.idx,ix.ofs,chunk, ixface.size());//D
211 218
212 packet sl ("ix"); 219 packet sl ("ix");
213 220
214 sl << ber32 (ix.idx) 221 sl << ber32 (ix.idx)
215 << ber32 (ix.ofs) 222 << ber32 (ix.ofs)
224 } 231 }
225 } 232 }
226 else 233 else
227 ix.ofs = 0; 234 ix.ofs = 0;
228 235
229 int consumed = ol - outputbuffer_len (); 236 int consumed = outputbuffer_len () - ol;
230 237
231 avail -= consumed; 238 avail -= consumed;
232 rate_avail -= consumed; 239 rate_avail -= consumed;
233 240
234 ol = outputbuffer_len (); 241 ol = outputbuffer_len ();
235 242
236 if (!ix.ofs) 243 if (!ix.ofs)
237 { 244 {
238 ixface.pop_back (); 245 ixface.pop_back ();
246
239 if (ixface.empty ()) 247 if (ixface.empty ())
240 break; 248 break;
241 } 249 }
242 } 250 }
243 } 251 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines