Lines Matching refs:sp

151 	Session *sp = (Session *) arg;
161 sockfd = sp->iod.socket;
162 buf = sp->in_buf->data;
164 PR_ASSERT(sp->msg_num < num_tcp_mesgs_per_connection);
165 PR_ASSERT(sp->bytes_read < sp->bytes);
167 offset = sp->bytes_read;
168 rem = sp->bytes - offset;
173 sp->bytes_read += bytes;
174 sp->iod.timeout = PR_SecondsToInterval(60);
175 if (sp->bytes_read < sp->bytes) {
176 jobp = PR_QueueJob_Read(sp->tp, &sp->iod, serve_client_read, sp,
181 PR_ASSERT(sp->bytes_read == sp->bytes);
182 DPRINTF(("serve_client: read complete, msg(%d) \n", sp->msg_num));
184 sp->iod.timeout = PR_SecondsToInterval(60);
185 jobp = PR_QueueJob_Write(sp->tp, &sp->iod, serve_client_write, sp,
195 Session *sp = (Session *) arg;
201 sockfd = sp->iod.socket;
202 buf = sp->in_buf->data;
204 PR_ASSERT(sp->msg_num < num_tcp_mesgs_per_connection);
206 bytes = PR_Send(sockfd, buf, sp->bytes, 0, PR_INTERVAL_NO_TIMEOUT);
207 PR_ASSERT(bytes == sp->bytes);
212 DPRINTF(("serve_client: write complete, msg(%d) \n", sp->msg_num));
213 sp->msg_num++;
214 if (sp->msg_num < num_tcp_mesgs_per_connection) {
215 sp->bytes_read = 0;
216 sp->iod.timeout = PR_SecondsToInterval(60);
217 jobp = PR_QueueJob_Read(sp->tp, &sp->iod, serve_client_read, sp,
223 DPRINTF(("serve_client: read/write complete, msg(%d) \n", sp->msg_num));
229 PR_EnterMonitor(sp->exit_mon);
230 --(*sp->job_counterp);
231 PR_Notify(sp->exit_mon);
232 PR_ExitMonitor(sp->exit_mon);
234 PR_DELETE(sp->in_buf);
235 PR_DELETE(sp);
251 Session *sp;
254 sp = PR_NEW(Session);
255 sp->iod = scp->iod;
264 sp->in_buf = in_buf;
265 sp->bytes = scp->datalen;
266 sp->msg_num = 0;
267 sp->bytes_read = 0;
268 sp->tp = scp->tp;
269 sp->exit_mon = scp->exit_mon;
270 sp->job_counterp = scp->job_counterp;
272 sp->iod.timeout = PR_SecondsToInterval(60);
273 jobp = PR_QueueJob_Read(sp->tp, &sp->iod, serve_client_read, sp,
282 Server_Param *sp = (Server_Param *) arg;
283 PRThreadPool *tp = sp->tp;
287 PR_EnterMonitor(sp->exit_mon);
288 counter = (*sp->job_counterp);
289 PR_ExitMonitor(sp->exit_mon);
295 print_stats, sp, PR_FALSE);
316 Server_Param *sp;
368 sp = PR_NEW(Server_Param);
369 if (sp == NULL) {
374 sp->iod.socket = sockfd;
375 sp->iod.timeout = PR_SecondsToInterval(60);
376 sp->datalen = tcp_mesg_size;
377 sp->exit_mon = sc_mon;
378 sp->job_counterp = &job_counter;
379 sp->conn_counter = 0;
380 sp->tp = tp;
381 sp->netaddr = netaddr;
384 jobp = PR_QueueJob_Accept(tp, &sp->iod, TCP_Server_Accept, sp,
435 sp->iod.socket = sockfd;
436 sp->iod.timeout = PR_SecondsToInterval(60);
437 sp->datalen = tcp_mesg_size;
438 sp->exit_mon = sc_mon;
439 sp->job_counterp = &job_counter;
440 sp->conn_counter = 0;
441 sp->tp = tp;
442 sp->netaddr = netaddr;
446 print_stats, sp, PR_FALSE);
453 jobp = PR_QueueJob_Accept(tp, &sp->iod, TCP_Server_Accept, sp,
462 Server_Param *sp = (Server_Param *) arg;
463 PRThreadPool *tp = sp->tp;
468 if ((newsockfd = PR_Accept(sp->iod.socket, &sp->netaddr,
487 scp->exit_mon = sp->exit_mon;
488 scp->job_counterp = sp->job_counterp;
489 scp->tp = sp->tp;
491 PR_EnterMonitor(sp->exit_mon);
492 (*sp->job_counterp)++;
493 PR_ExitMonitor(sp->exit_mon);
503 sp->conn_counter++;
504 if (sp->conn_counter <
506 jobp = PR_QueueJob_Accept(tp, &sp->iod, TCP_Server_Accept, sp,
512 print_stats, sp, PR_FALSE);
518 PR_EnterMonitor(sp->exit_mon);
520 while (0 != *sp->job_counterp) {
521 PR_Wait(sp->exit_mon, PR_INTERVAL_NO_TIMEOUT);
523 *sp->job_counterp));
526 PR_ExitMonitor(sp->exit_mon);
527 if (sp->iod.socket) {
528 PR_Close(sp->iod.socket);
530 PR_DestroyMonitor(sp->exit_mon);
538 PR_ShutdownThreadPool(sp->tp);
539 PR_DELETE(sp);