~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/session.cc

  • Committer: Brian Aker
  • Date: 2008-12-16 05:27:55 UTC
  • Revision ID: brian@tangent.org-20081216052755-jp62skyl1qb2yza3
Cleaning up session class.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2570
2570
  @note
2571
2571
    For the connection that is doing shutdown, this is called twice
2572
2572
*/
2573
 
void close_connection(Session *session, uint32_t errcode, bool lock)
 
2573
void Session::close_connection(uint32_t errcode, bool lock)
2574
2574
{
2575
2575
  st_vio *vio;
2576
2576
  if (lock)
2577
2577
    (void) pthread_mutex_lock(&LOCK_thread_count);
2578
 
  session->killed= Session::KILL_CONNECTION;
2579
 
  if ((vio= session->net.vio) != 0)
 
2578
  killed= Session::KILL_CONNECTION;
 
2579
  if ((vio= net.vio) != 0)
2580
2580
  {
2581
2581
    if (errcode)
2582
 
      net_send_error(session, errcode, ER(errcode)); /* purecov: inspected */
2583
 
    net_close(&(session->net));         /* vio is freed in delete session */
 
2582
      net_send_error(this, errcode, ER(errcode)); /* purecov: inspected */
 
2583
    net_close(&net);            /* vio is freed in delete session */
2584
2584
  }
2585
2585
  if (lock)
2586
2586
    (void) pthread_mutex_unlock(&LOCK_thread_count);
2587
 
  return;;
2588
2587
}