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.43 by root, Fri Mar 16 02:37:54 2007 UTC vs.
Revision 1.44 by root, Mon Apr 2 19:56:11 2007 UTC

172 if (update_look) 172 if (update_look)
173 esrv_draw_look (pl->ob); 173 esrv_draw_look (pl->ob);
174 174
175 if (askface.empty ()) 175 if (askface.empty ())
176 { 176 {
177 // regularly send a new face when queue is empty
177 if (bg_scrub && !--bg_scrub && enable_bg_scrub) 178 if (bg_scrub && !--bg_scrub && enable_bg_scrub)
178 while (scrub_idx < faces.size () - 1) 179 while (scrub_idx < faces.size () - 1)
179 { 180 {
180 ++scrub_idx; 181 ++scrub_idx;
181 if (!faces_sent [scrub_idx]) 182 if (!faces_sent [scrub_idx])
183 send_face (scrub_idx); 184 send_face (scrub_idx);
184 bg_scrub = 1; // send up to one face per tick, unless an image was requested 185 bg_scrub = 1; // send up to one face per tick, unless an image was requested
185 break; 186 break;
186 } 187 }
187 } 188 }
189
190 rate_avail = max_rate - outputbuffer_len ();
188 } 191 }
189 else 192 else
190 while (!askface.empty () && outputbuffer_len () < max_rate) 193 {
194 int ol = outputbuffer_len ();
195
196 rate_avail = min (max_rate, rate_avail + max_rate);
197 rate_avail -= ol;
198
199 int avail = rate_avail;
191 { 200
201 // if we can split images, transfer up to mss packets if possible
202 if (fxix) avail += mss - (ol % mss);
203
204 fprintf (stderr, "ra %6d a %6d ", rate_avail, avail);
205
206 while (!askface.empty () && avail > 0)
207 {
192 // use a lifo to send most recently requested images 208 // use a lifo to send most recently requested images
193 faceidx face = askface.back (); 209 faceidx face = askface.back ();
194 askface.pop_back (); 210 askface.pop_back ();
195 211
196 send_image (face); 212 send_image (face);
197 213
198 bg_scrub = BG_SCRUB_RATE; 214 bg_scrub = BG_SCRUB_RATE;
215
216 int consumed = ol - outputbuffer_len ();
217 avail -= consumed;
218 rate_avail -= consumed;
199 } 219 }
200}
201 220
221 fprintf (stderr, "ra %6d a %6d\n", rate_avail, avail);
222
223 }
224}
225

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines